Linux bluetooth development
 help / color / mirror / Atom feed
From: Simon Mikuda <simon.mikuda@streamunlimited.com>
To: linux-bluetooth@vger.kernel.org
Cc: Simon Mikuda <simon.mikuda@streamunlimited.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Subject: [PATCH] Bluetooth: SMP: Pair without bonding when not bondable
Date: Sun, 22 Nov 2026 16:31:36 +0100	[thread overview]
Message-ID: <20261122153136.1522998-1-simon.mikuda@streamunlimited.com> (raw)

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


                 reply	other threads:[~2026-11-22 15:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261122153136.1522998-1-simon.mikuda@streamunlimited.com \
    --to=simon.mikuda@streamunlimited.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox