Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe806dce authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg
Browse files

Bluetooth: Enforce packet types in hci_recv_frame driver function



When calling the hci_recv_frame driver function check for valid packet
types that the core should process. This should catch issues with
drivers trying to feed vendor packet types through this interface.

Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 943cc592
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -3538,6 +3538,13 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
		return -ENXIO;
		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 */
	/* Incoming skb */
	bt_cb(skb)->incoming = 1;
	bt_cb(skb)->incoming = 1;