Bluetooth: Fix rejecting SMP security request in slave role

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:06 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=86ca9eac31d0d8c4fe61b5726e6d63197bc435a6
Commit:     86ca9eac31d0d8c4fe61b5726e6d63197bc435a6
Parent:     31e8ce80baa7eaed9eec611deba982b24beed9e5
Author:     Johan Hedberg <johan.hedberg at intel.com>
AuthorDate: Tue Nov 5 11:30:39 2013 +0200
Committer:  Gustavo Padovan <gustavo.padovan at collabora.co.uk>
CommitDate: Wed Nov 13 11:36:54 2013 -0200

    Bluetooth: Fix rejecting SMP security request in slave role
    
    The SMP security request is for a slave role device to request the
    master role device to initiate a pairing request. If we receive this
    command while we're in the slave role we should reject it appropriately.
    
    Signed-off-by: Johan Hedberg <johan.hedberg at intel.com>
    Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
---
 net/bluetooth/smp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index b5562ab..ccad6c1 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -739,6 +739,9 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
 
 	BT_DBG("conn %p", conn);
 
+	if (!(conn->hcon->link_mode & HCI_LM_MASTER))
+		return SMP_CMD_NOTSUPP;
+
 	hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req);
 
 	if (smp_ltk_encrypt(conn, hcon->pending_sec_level))



More information about the linux-mtd-cvs mailing list