Skip to contentSkip to conversation

Bluetooth: Add clarifying comment for conn->auth_type

PATCH In review [email protected] 2 participants 2 messages Jun 9, 2014 – Jun 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Add clarifying comment for conn->auth_type

From: Johan Hedberg <[email protected]>

When responding to an IO capability request when we're the initiators of the pairing we will not yet have the remote IO capability information. Since the conn->auth_type variable is treated as an "absolute" requirement instead of a hint of what's needed later in the user confirmation request handler it's important that it doesn't have the MITM bit set if there's any chance that the remote device doesn't have the necessary IO capabilities.

This patch adds a clarifying comment so that conn->auth_type is left untouched in this scenario.

---
 net/bluetooth/hci_event.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/bluetooth/hci_event.c +5 -1
index 67a9cf4143ae..6a7ae9b519a2 100644
@@ -3531,7 +3531,11 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
 			cp.authentication = conn->auth_type;
 
 			/* Request MITM protection if our IO caps allow it
-			 * except for the no-bonding case
+			 * except for the no-bonding case.
+			 * conn->auth_type is not updated here since
+			 * that might cause the user confirmation to be
+			 * rejected in case the remote doesn't have the
+			 * IO capabilities for MITM.
 			 */
 			if (conn->io_capability != HCI_IO_NO_INPUT_OUTPUT &&
 			    cp.authentication != HCI_AT_NO_BONDING)
Signature · 1 line
1.9.3
maintainer
#1 lore raw

Hi Johan,

Quoted 8 lines

When responding to an IO capability request when we're the initiators of the pairing we will not yet have the remote IO capability information. Since the conn->auth_type variable is treated as an "absolute" requirement instead of a hint of what's needed later in the user confirmation request handler it's important that it doesn't have the MITM bit set if there's any chance that the remote device doesn't have the necessary IO capabilities.

Quoted 7 lines

This patch adds a clarifying comment so that conn->auth_type is left untouched in this scenario.

---
net/bluetooth/hci_event.c | 6 +++++-

1 file changed, 5 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel