Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: SMP: Pair without bonding when not bondable
@ 2026-11-22 15:31 Simon Mikuda
  2026-11-22 17:29 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-22 15:31 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz

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")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/smp.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 2538096cae06..49cc972b3338 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -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
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-22 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 15:31 [PATCH] Bluetooth: SMP: Pair without bonding when not bondable Simon Mikuda
2026-11-22 17:29 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox