All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Enforce packet types in hci_recv_frame driver function
@ 2015-10-08  1:14 Marcel Holtmann
  2015-10-08  7:06 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2015-10-08  1:14 UTC (permalink / raw)
  To: linux-bluetooth

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: Marcel Holtmann <marcel@holtmann.org>
---
 net/bluetooth/hci_core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 43a1f2d8ffd3..b2095ca8472e 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -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;
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: Enforce packet types in hci_recv_frame driver function
  2015-10-08  1:14 [PATCH] Bluetooth: Enforce packet types in hci_recv_frame driver function Marcel Holtmann
@ 2015-10-08  7:06 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2015-10-08  7:06 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On Thu, Oct 08, 2015, Marcel Holtmann wrote:
> 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: Marcel Holtmann <marcel@holtmann.org>
> ---
>  net/bluetooth/hci_core.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied to bluetooth-next. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-08  7:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-08  1:14 [PATCH] Bluetooth: Enforce packet types in hci_recv_frame driver function Marcel Holtmann
2015-10-08  7:06 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.