Bluetooth: Restrict blocked device check in l2cap_recv_frame to LE
authorJohan Hedberg <johan.hedberg@intel.com>
Sun, 6 Jul 2014 08:03:36 +0000 (11:03 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 6 Jul 2014 08:13:56 +0000 (10:13 +0200)
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.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap_core.c

index dbef22d644e2cf185ec8ae0bbd143805bd22a345..f1f544a12c3cb2aedaf18bd895eb3ce4a0d664fd 100644 (file)
@@ -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;