From: Marcel Holtmann Date: Thu, 3 Oct 2013 07:00:57 +0000 (-0700) Subject: Bluetooth: SMP packets are only valid on LE connections X-Git-Tag: v3.13-rc1~105^2~225^2~24^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b9899dbcf432b188f3cc22bd1ad9e8050c496fc;p=platform%2Fkernel%2Flinux-stable.git Bluetooth: SMP packets are only valid on LE connections When receiving SMP packets on a BR/EDR connection, then just drop the packet and do not try to process it. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index b5562ab..6e049497 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -847,10 +847,16 @@ static int smp_cmd_master_ident(struct l2cap_conn *conn, struct sk_buff *skb) int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb) { + struct hci_conn *hcon = conn->hcon; __u8 code = skb->data[0]; __u8 reason; int err = 0; + if (hcon->type != LE_LINK) { + kfree_skb(skb); + return -ENOTSUPP; + } + if (!test_bit(HCI_LE_ENABLED, &conn->hcon->hdev->dev_flags)) { err = -ENOTSUPP; reason = SMP_PAIRING_NOTSUPP;