Skip to contentSkip to conversation

Bluetooth: Restrict blocked device check in l2cap_recv_frame to LE

PATCH In review [email protected] 2 participants 2 messages Jul 6, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Restrict blocked device check in l2cap_recv_frame to LE

From: Johan Hedberg <[email protected]>

BR/EDR has the connection request and connection request rejection, but LE doesn't have anything similar. We still request LE connections to blocked devices to be disconnected but it's possible that ACL data slips through before that. The check in l2cap_recv_frame really only needs to be for LE and not BR/EDR because of this.

---
 net/bluetooth/l2cap_core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/bluetooth/l2cap_core.c +5 -1
index dbef22d644e2..f1f544a12c3c 100644
@@ -6914,7 +6914,11 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb)
 		return;
 	}
 
-	if (hci_blacklist_lookup(hcon->hdev, &hcon->dst,
+	/* Since we can't actively block incoming LE connections we must
+	 * at least ensure that we ignore incoming data from them.
+	 */
+	if (hcon->type == LE_LINK &&
+	    hci_blacklist_lookup(hcon->hdev, &hcon->dst,
 				 bdaddr_type(hcon, hcon->dst_type))) {
 		kfree_skb(skb);
 		return;
Signature · 1 line
1.9.3
maintainer
#1 lore raw

Hi Johan,

Quoted 10 lines

BR/EDR has the connection request and connection request rejection, but LE doesn't have anything similar. We still request LE connections to blocked devices to be disconnected but it's possible that ACL data slips through before that. The check in l2cap_recv_frame really only needs to be for LE and not BR/EDR because of this.

---
net/bluetooth/l2cap_core.c | 6 +++++-

1 file changed, 5 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel