summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohan Hedberg2014-07-02 08:36:21 +0200
committerMarcel Holtmann2014-07-03 17:42:55 +0200
commite493150e363917bf7e86e8fa4316e915fc2cf40b (patch)
treea14cd3dbc55162e069cb312d23ae9535d56e43d5 /net
parentBluetooth: Add public address configration for Broadcom USB devices (diff)
downloadkernel-qcow2-linux-e493150e363917bf7e86e8fa4316e915fc2cf40b.tar.gz
kernel-qcow2-linux-e493150e363917bf7e86e8fa4316e915fc2cf40b.tar.xz
kernel-qcow2-linux-e493150e363917bf7e86e8fa4316e915fc2cf40b.zip
Bluetooth: Centralize looking up blocked devices to l2cap_recv_frame
The ATT channel isn't the only one that we should ensure doesn't receive data from blocked devices. SMP is another, and in general we don't want data packets going to any of the various handlers. Therefore, add a single check to the l2cap_recv_frame function. The patch fixes at the same time the use of a correct address type. The blacklist stores the values with the user space facing triple type wheras hci_conn->dst_type uses the HCI address type (0x00 or 0x01). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap_core.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 058b3b2b59b5..a6e276204ae9 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -6878,9 +6878,6 @@ static void l2cap_att_channel(struct l2cap_conn *conn,
BT_DBG("chan %p, len %d", chan, skb->len);
- if (hci_blacklist_lookup(hcon->hdev, &hcon->dst, hcon->dst_type))
- goto drop;
-
if (chan->imtu < skb->len)
goto drop;
@@ -6913,6 +6910,12 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb)
return;
}
+ if (hci_blacklist_lookup(hcon->hdev, &hcon->dst,
+ bdaddr_type(hcon, hcon->dst_type))) {
+ kfree_skb(skb);
+ return;
+ }
+
BT_DBG("len %d, cid 0x%4.4x", len, cid);
switch (cid) {