[linux-yocto] FW: [PATCH] Bluetooth: Delay check for conn->smp in smp_conn_security()

Zheng, Wu wu.zheng at intel.com
Tue Sep 15 02:14:41 PDT 2015


Hi all,

I am sorry to send a few copies of this patch there.

According to the original author request, the patch need to keep the original author info.

Therefore, I modified the related comments, so that match the author request.

Best Regards
Zheng Wu

>-----Original Message-----
>From: linux-yocto-bounces at yoctoproject.org
>[mailto:linux-yocto-bounces at yoctoproject.org] On Behalf Of Wu Zheng
>Sent: Tuesday, September 15, 2015 5:11 PM
>To: linux-yocto at yoctoproject.org
>Cc: Marcel Holtmann; Hedberg, Johan
>Subject: [linux-yocto] [PATCH] Bluetooth: Delay check for conn->smp in
>smp_conn_security()
>
>From: Johan Hedberg <johan.hedberg at intel.com>
>
>There are several actions that smp_conn_security() might make that do not
>require a valid SMP context (conn->smp pointer). One of these actions is to
>encrypt the link with an existing LTK. If the SMP context wasn't initialized
>properly we should still allow the independent actions to be done, i.e. the check
>for the context should only be done at the last possible moment.
>
>Reported-by: Chuck Ebbert <cebbert.lkml at gmail.com>
>Signed-off-by: Johan Hedberg <johan.hedberg at intel.com>
>Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
>---
> net/bluetooth/smp.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
>diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index ad82324..0510a57
>100644
>--- a/net/bluetooth/smp.c
>+++ b/net/bluetooth/smp.c
>@@ -2311,12 +2311,6 @@ int smp_conn_security(struct hci_conn *hcon, __u8
>sec_level)
> 	if (!conn)
> 		return 1;
>
>-	chan = conn->smp;
>-	if (!chan) {
>-		BT_ERR("SMP security requested but not available");
>-		return 1;
>-	}
>-
> 	if (!hci_dev_test_flag(hcon->hdev, HCI_LE_ENABLED))
> 		return 1;
>
>@@ -2330,6 +2324,12 @@ int smp_conn_security(struct hci_conn *hcon, __u8
>sec_level)
> 		if (smp_ltk_encrypt(conn, hcon->pending_sec_level))
> 			return 0;
>
>+	chan = conn->smp;
>+	if (!chan) {
>+		BT_ERR("SMP security requested but not available");
>+		return 1;
>+	}
>+
> 	l2cap_chan_lock(chan);
>
> 	/* If SMP is already in progress ignore this request */
>--
>2.1.4
>
>--
>_______________________________________________
>linux-yocto mailing list
>linux-yocto at yoctoproject.org
>https://lists.yoctoproject.org/listinfo/linux-yocto


More information about the linux-yocto mailing list