Skip to content

Commit b7e0473

Browse files
committed
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
2 parents 73f0b56 + 1bc5ad1 commit b7e0473

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

‎drivers/bluetooth/ath3k.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ static const struct usb_device_id ath3k_table[] = {
8787
{ USB_DEVICE(0x0CF3, 0xE004) },
8888
{ USB_DEVICE(0x0CF3, 0xE005) },
8989
{ USB_DEVICE(0x0930, 0x0219) },
90+
{ USB_DEVICE(0x0930, 0x0220) },
9091
{ USB_DEVICE(0x0489, 0xe057) },
9192
{ USB_DEVICE(0x13d3, 0x3393) },
9293
{ USB_DEVICE(0x0489, 0xe04e) },
@@ -129,6 +130,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
129130
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
130131
{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
131132
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
133+
{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
132134
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
133135
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
134136
{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },

‎drivers/bluetooth/btusb.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ static const struct usb_device_id blacklist_table[] = {
154154
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
155155
{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
156156
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
157+
{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
157158
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
158159
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
159160
{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },

‎net/bluetooth/hci_sock.c‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,22 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
940940
bt_cb(skb)->pkt_type = *((unsigned char *) skb->data);
941941
skb_pull(skb, 1);
942942

943-
if (hci_pi(sk)->channel == HCI_CHANNEL_RAW &&
944-
bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
943+
if (hci_pi(sk)->channel == HCI_CHANNEL_USER) {
944+
/* No permission check is needed for user channel
945+
* since that gets enforced when binding the socket.
946+
*
947+
* However check that the packet type is valid.
948+
*/
949+
if (bt_cb(skb)->pkt_type != HCI_COMMAND_PKT &&
950+
bt_cb(skb)->pkt_type != HCI_ACLDATA_PKT &&
951+
bt_cb(skb)->pkt_type != HCI_SCODATA_PKT) {
952+
err = -EINVAL;
953+
goto drop;
954+
}
955+
956+
skb_queue_tail(&hdev->raw_q, skb);
957+
queue_work(hdev->workqueue, &hdev->tx_work);
958+
} else if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
945959
u16 opcode = get_unaligned_le16(skb->data);
946960
u16 ogf = hci_opcode_ogf(opcode);
947961
u16 ocf = hci_opcode_ocf(opcode);
@@ -972,14 +986,6 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
972986
goto drop;
973987
}
974988

975-
if (hci_pi(sk)->channel == HCI_CHANNEL_USER &&
976-
bt_cb(skb)->pkt_type != HCI_COMMAND_PKT &&
977-
bt_cb(skb)->pkt_type != HCI_ACLDATA_PKT &&
978-
bt_cb(skb)->pkt_type != HCI_SCODATA_PKT) {
979-
err = -EINVAL;
980-
goto drop;
981-
}
982-
983989
skb_queue_tail(&hdev->raw_q, skb);
984990
queue_work(hdev->workqueue, &hdev->tx_work);
985991
}

0 commit comments

Comments
 (0)