All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: SMP: reject Security Request over BR/EDR
@ 2026-09-16 13:46 Christiano Amora
  2026-09-16 15:35 ` bluez.test.bot
  2026-09-16 17:40 ` [PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Christiano Amora @ 2026-09-16 13:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: marcel, luiz.dentz, Christiano Amora

Bose QC Ultra Headphones (dual-mode, same public address on both
transports) occasionally send an SMP Security Request on the BR/EDR
SMP fixed channel right after the ACL link is encrypted. The kernel
handles it as if it were an LE link: smp_cmd_security_req() has no
transport check, smp_ltk_encrypt() looks up an LTK with the ACL
connection's dst_type, and hci_find_ltk() matches the peer's LE LTK
because the LE public address type is stored as ADDR_LE_DEV_PUBLIC (0),
the same value as BDADDR_BREDR. HCI_OP_LE_START_ENC is then issued on
the ACL handle, the controller rejects it with Invalid HCI Command
Parameters, and hci_cs_le_start_enc() disconnects the link with
HCI_ERROR_AUTH_FAILURE. The headphones drop within a second of
connecting, before any profile is up; a manual reconnect works.

btmon (MediaTek MT7922, kernel 7.0.12):

  > HCI Event: Encryption Change (0x08) plen 4
        Status: Success (0x00)
        Handle: 50 Address: BC:87:FA:47:73:5E (Bose Corporation)
        Encryption: Enabled with AES-CCM (0x02)
  > ACL Data RX: Handle 50 flags 0x02 dlen 6
        BR/EDR SMP: Security Request (0x0b) len 1
        Authentication requirement: No bonding, No MITM, SC (0x08)
  < HCI Command: LE Start Encryption (0x08|0x0019) plen 28
        Handle: 50 Address: BC:87:FA:47:73:5E (Bose Corporation)
  > HCI Event: Command Status (0x0f) plen 4
        LE Start Encryption (0x08|0x0019) ncmd 1
        Status: Invalid HCI Command Parameters (0x12)
  < HCI Command: Disconnect (0x01|0x0006) plen 3
        Handle: 50 Address: BC:87:FA:47:73:5E (Bose Corporation)
        Reason: Authentication Failure (0x05)

SMP over BR/EDR is limited to cross-transport key derivation; the
Security Request procedure (Core Specification Vol 3, Part H, Section
2.4.6, PDU in Section 3.6.7) has no BR/EDR counterpart. Reply with
Pairing Failed / Command Not Supported on a non-LE link, before the PDU
is parsed, and keep the connection. The reply is sent directly rather
than through smp_failure(): rejecting a command on the wrong transport
is not an authentication failure, and MGMT_EV_AUTH_FAILED would make
bluetoothd disconnect the device.

Tested on the affected host (kernel 7.0.12, MediaTek MT7922, Bose QC
Ultra) with the patched module built out of tree: 7 days and 49
reconnects without a drop, against 2 drops in the 3 days before the
patch. Every disconnect in that week had a userspace or remote reason.

Fixes: b5ae344d4c0f ("Bluetooth: Add full SMP BR/EDR support")
Assisted-by: LLM
Signed-off-by: Christiano Amora <christiano.amora@gmail.com>
---
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 98f1da4..7792f48 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2301,6 +2301,23 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
 
 	bt_dev_dbg(hdev, "conn %p", conn);
 
+	/* SMP over BR/EDR only covers cross-transport key derivation; the
+	 * Security Request procedure has no BR/EDR counterpart. Reject it
+	 * here, otherwise smp_ltk_encrypt() finds the peer's LE LTK
+	 * (ADDR_LE_DEV_PUBLIC and BDADDR_BREDR are both 0) and issues
+	 * HCI_OP_LE_START_ENC on the ACL handle, which the controller
+	 * rejects and hci_cs_le_start_enc() turns into a disconnect. Reply
+	 * without smp_failure(): this is not an authentication failure, and
+	 * MGMT_EV_AUTH_FAILED would make bluetoothd drop the device.
+	 */
+	if (hcon->type != LE_LINK) {
+		u8 reason = SMP_CMD_NOTSUPP;
+
+		smp_send_cmd(conn, SMP_CMD_PAIRING_FAIL, sizeof(reason),
+			     &reason);
+		return 0;
+	}
+
 	if (skb->len < sizeof(*rp))
 		return SMP_INVALID_PARAMS;
 

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

* RE: Bluetooth: SMP: reject Security Request over BR/EDR
  2026-09-16 13:46 [PATCH] Bluetooth: SMP: reject Security Request over BR/EDR Christiano Amora
@ 2026-09-16 15:35 ` bluez.test.bot
  2026-09-16 17:40 ` [PATCH] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-09-16 15:35 UTC (permalink / raw)
  To: linux-bluetooth, christiano.amora

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

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/1166514/

---Test result---

Test Summary:
CheckPatch                    PASS      0.65 seconds
VerifyFixes                   PASS      0.10 seconds
VerifySignedoff               PASS      0.10 seconds
GitLint                       PASS      0.27 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      22.18 seconds
CheckAllWarning               PASS      25.11 seconds
CheckSparse                   PASS      27.16 seconds
BuildKernel32                 PASS      21.93 seconds
CheckKernelLLVM               PASS      24.58 seconds
TestRunnerSetup               PASS      578.85 seconds
TestRunner_smp-tester         PASS      6.92 seconds
IncrementalBuild              PASS      30.31 seconds



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

---
Regards,
Linux Bluetooth


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

* Re: [PATCH] Bluetooth: SMP: reject Security Request over BR/EDR
  2026-09-16 13:46 [PATCH] Bluetooth: SMP: reject Security Request over BR/EDR Christiano Amora
  2026-09-16 15:35 ` bluez.test.bot
@ 2026-09-16 17:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-09-16 17:40 UTC (permalink / raw)
  To: Christiano Amora; +Cc: linux-bluetooth, marcel, luiz.dentz

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 16 Sep 2026 10:46:22 -0300 you wrote:
> Bose QC Ultra Headphones (dual-mode, same public address on both
> transports) occasionally send an SMP Security Request on the BR/EDR
> SMP fixed channel right after the ACL link is encrypted. The kernel
> handles it as if it were an LE link: smp_cmd_security_req() has no
> transport check, smp_ltk_encrypt() looks up an LTK with the ACL
> connection's dst_type, and hci_find_ltk() matches the peer's LE LTK
> because the LE public address type is stored as ADDR_LE_DEV_PUBLIC (0),
> the same value as BDADDR_BREDR. HCI_OP_LE_START_ENC is then issued on
> the ACL handle, the controller rejects it with Invalid HCI Command
> Parameters, and hci_cs_le_start_enc() disconnects the link with
> HCI_ERROR_AUTH_FAILURE. The headphones drop within a second of
> connecting, before any profile is up; a manual reconnect works.
> 
> [...]

Here is the summary with links:
  - Bluetooth: SMP: reject Security Request over BR/EDR
    https://git.kernel.org/bluetooth/bluetooth-next/c/f033482d76a9

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-09-16 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 13:46 [PATCH] Bluetooth: SMP: reject Security Request over BR/EDR Christiano Amora
2026-09-16 15:35 ` bluez.test.bot
2026-09-16 17:40 ` [PATCH] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.