Skip to contentSkip to conversation

Bluetooth: Fix resetting remote authentication requirement after pairing

PATCH Superseded [email protected] 2 participants 3 messages Jul 17, 2014

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

PATCH 1/1 Bluetooth: Fix resetting remote authentication requirement after pairing

From: Johan Hedberg <[email protected]>

When a new hci_conn object the remote SSP authentication requirement is set to the invalid value 0xff to indicate that it is unknown. Once pairing completes however the code was leaving it as-is. In case a new pairing happens over the same connection it is important that we reset the value back to unknown so that the pairing code doesn't make false assumptions about the requirements.

---
 net/bluetooth/hci_event.c | 3 +++
 1 file changed, 3 insertions(+)
net/bluetooth/hci_event.c +3 -0
index 041e5c018891..4c41774aa556 100644
@@ -3880,6 +3880,9 @@ static void hci_simple_pair_complete_evt(struct hci_dev *hdev,
 	if (!conn)
 		goto unlock;
 
+	/* Reset the authentication requirement to unknown */
+	conn->remote_auth = 0xff;
+
 	/* To avoid duplicate auth_failed events to user space we check
 	 * the HCI_CONN_AUTH_PEND flag which will be set if we
 	 * initiated the authentication. A traditional auth_complete
Signature · 1 line
1.9.3
#1 lore raw

PATCH v2 1/1 Bluetooth: Fix resetting remote authentication requirement after pairing

From: Johan Hedberg <[email protected]>

When a new hci_conn object is created the remote SSP authentication requirement is set to the invalid value 0xff to indicate that it is unknown. Once pairing completes however the code was leaving it as-is. In case a new pairing happens over the same connection it is important that we reset the value back to unknown so that the pairing code doesn't make false assumptions about the requirements.

---
v2: Fix incomplete sentence in commit message

 net/bluetooth/hci_event.c | 3 +++
 1 file changed, 3 insertions(+)
net/bluetooth/hci_event.c +3 -0
index 041e5c018891..4c41774aa556 100644
@@ -3880,6 +3880,9 @@ static void hci_simple_pair_complete_evt(struct hci_dev *hdev,
 	if (!conn)
 		goto unlock;
 
+	/* Reset the authentication requirement to unknown */
+	conn->remote_auth = 0xff;
+
 	/* To avoid duplicate auth_failed events to user space we check
 	 * the HCI_CONN_AUTH_PEND flag which will be set if we
 	 * initiated the authentication. A traditional auth_complete
Signature · 1 line
1.9.3
maintainer
#2 lore raw

Hi Johan,

Quoted 7 lines

When a new hci_conn object is created the remote SSP authentication requirement is set to the invalid value 0xff to indicate that it is unknown. Once pairing completes however the code was leaving it as-is. In case a new pairing happens over the same connection it is important that we reset the value back to unknown so that the pairing code doesn't make false assumptions about the requirements.

Quoted 6 lines

---
v2: Fix incomplete sentence in commit message

net/bluetooth/hci_event.c | 3 +++

1 file changed, 3 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel