[ 3.5.y.z extended stable ] Patch "Bluetooth: Fix security level for peripheral role" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Fri Oct 11 10:24:33 UTC 2013
This is a note to let you know that I have just added a patch titled
Bluetooth: Fix security level for peripheral role
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 1f78891a924eeeb69b54b2db92e4316ff32af93f Mon Sep 17 00:00:00 2001
From: Andre Guedes <andre.guedes at openbossa.org>
Date: Wed, 31 Jul 2013 16:25:28 -0300
Subject: [PATCH] Bluetooth: Fix security level for peripheral role
commit f8776218e8546397be64ad2bc0ebf4748522d6e3 upstream.
While playing the peripheral role, the host gets a LE Long Term Key
Request Event from the controller when a connection is established
with a bonded device. The host then informs the LTK which should be
used for the connection. Once the link is encrypted, the host gets
an Encryption Change Event.
Therefore we should set conn->pending_sec_level instead of conn->
sec_level in hci_le_ltk_request_evt. This way, conn->sec_level is
properly updated in hci_encrypt_change_evt.
Moreover, since we have a LTK associated to the device, we have at
least BT_SECURITY_MEDIUM security level.
Signed-off-by: Andre Guedes <andre.guedes at openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
net/bluetooth/hci_event.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 843d048..9871e8b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3452,7 +3452,9 @@ static inline void hci_le_ltk_request_evt(struct hci_dev *hdev,
cp.handle = cpu_to_le16(conn->handle);
if (ltk->authenticated)
- conn->sec_level = BT_SECURITY_HIGH;
+ conn->pending_sec_level = BT_SECURITY_HIGH;
+ else
+ conn->pending_sec_level = BT_SECURITY_MEDIUM;
hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
--
1.8.3.2
More information about the kernel-team
mailing list