Skip to contentSkip to conversation

Bluetooth: SMP: Pair without bonding when not bondable

PATCH In review Simon Mikuda 2 participants 2 messages Nov 22

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

PATCH 1/1 Bluetooth: SMP: Pair without bonding when not bondable

With HCI_BONDABLE cleared, a Pairing Request or Security Request that asks for bonding is rejected with Pairing Not Supported. A device in non-bondable mode should pair without bonding instead: answer with the bonding flag cleared and keep no keys.

PTS test CAP/CL/ADV/BV-01-C fails on the rejection.

Mask SMP_AUTH_BONDING out of the requested authentication, as SMP did before b3c6410b8c75.

Fixes b3c6410b8c75 ("Bluteooth: Reject SMP bonding if HCI_PAIRABLE is not set")
---
 net/bluetooth/smp.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
net/bluetooth/smp.c +4 -6
index 2538096cae06..49cc972b3338 100644
@@ -1746,9 +1746,8 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb)
 	/* We didn't start the pairing, so match remote */
 	auth = req->auth_req & AUTH_REQ_MASK(hdev);
 
-	if (!hci_dev_test_flag(hdev, HCI_BONDABLE) &&
-	    (auth & SMP_AUTH_BONDING))
-		return SMP_PAIRING_NOTSUPP;
+	if (!hci_dev_test_flag(hdev, HCI_BONDABLE))
+		auth &= ~SMP_AUTH_BONDING;
 
 	if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && !(auth & SMP_AUTH_SC))
 		return SMP_AUTH_REQUIREMENTS;
@@ -2357,9 +2356,8 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
 	if (!smp)
 		return SMP_UNSPECIFIED;
 
-	if (!hci_dev_test_flag(hdev, HCI_BONDABLE) &&
-	    (auth & SMP_AUTH_BONDING))
-		return SMP_PAIRING_NOTSUPP;
+	if (!hci_dev_test_flag(hdev, HCI_BONDABLE))
+		auth &= ~SMP_AUTH_BONDING;
 
 	skb_pull(skb, sizeof(*rp));
 

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96

Signature · 1 line
2.43.0
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1218698/

---Test result---

Test Summary:

CheckPatch                    PASS      0.79 seconds
VerifyFixes                   PASS      0.13 seconds
VerifySignedoff               PASS      0.14 seconds
GitLint                       PASS      0.36 seconds
SubjectPrefix                 PASS      0.13 seconds
BuildKernel                   PASS      30.76 seconds
CheckAllWarning               PASS      35.10 seconds
CheckSparse                   PASS      36.91 seconds
BuildKernel32                 PASS      30.52 seconds
CheckKernelLLVM               PASS      33.19 seconds
TestRunnerSetup               PASS      739.46 seconds
TestRunner_smp-tester         PASS      5.42 seconds
IncrementalBuild              PASS      28.58 seconds

https://github.com/bluez/bluetooth-next/pull/1182

---
Regards,
Linux Bluetooth