]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/bluetooth/hci_core.c
Bluetooth: Enforce packet types in hci_recv_frame driver function
[mirror_ubuntu-bionic-kernel.git] / net / bluetooth / hci_core.c
index 43a1f2d8ffd31aaee9b010ad8c4d85ca9eccaa75..b2095ca8472e80dde19c5a4834f34156fea5dca2 100644 (file)
@@ -3538,6 +3538,13 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
                return -ENXIO;
        }
 
+       if (bt_cb(skb)->pkt_type != HCI_EVENT_PKT &&
+           bt_cb(skb)->pkt_type != HCI_ACLDATA_PKT &&
+           bt_cb(skb)->pkt_type != HCI_SCODATA_PKT) {
+               kfree_skb(skb);
+               return -EINVAL;
+       }
+
        /* Incoming skb */
        bt_cb(skb)->incoming = 1;