public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Bluetooth: SMP: honor local MITM requirements for legacy pairing
@ 2026-03-31 11:52 Oleh Konko
  2026-03-31 11:52 ` [PATCH v4 1/2] Bluetooth: SMP: force responder MITM requirements before building the pairing response Oleh Konko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Oleh Konko @ 2026-03-31 11:52 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org
  Cc: marcel@holtmann.org, luiz.dentz@gmail.com,
	linux-kernel@vger.kernel.org

hi,

this v4 series follows up on Luiz's latest review direction.

1/2 moves the primary fix into smp_cmd_pairing_req(): when the local
side requires BT_SECURITY_HIGH, the responder first verifies that MITM
is achievable and then forces SMP_AUTH_MITM in the pairing response so
the responder auth bits and later method selection stay aligned.

2/2 keeps the stored legacy responder STK authentication bit tied to the
achieved MITM state rather than to pending_sec_level. that keeps the key
metadata consistent with the pairing result as defense in depth.

both patches carry Fixes and Cc: stable.

if anyone with recent Bluetooth qualification access can run this
against PTS as well, that would still be very helpful.

thanks,
Oleh


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH v3 1/2] Bluetooth: SMP: honor local HIGH security when selecting legacy pairing method
@ 2026-03-30 15:33 Oleh Konko
  2026-03-30 16:25 ` Bluetooth: SMP: honor local MITM requirements for legacy pairing bluez.test.bot
  0 siblings, 1 reply; 6+ messages in thread
From: Oleh Konko @ 2026-03-30 15:33 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org
  Cc: marcel@holtmann.org, luiz.dentz@gmail.com,
	linux-kernel@vger.kernel.org

tk_request() currently forces JUST_CFM whenever the remote auth_req
omits SMP_AUTH_MITM. That ignores the local pending_sec_level, even
though the responder may still require BT_SECURITY_HIGH.

The pairing-request path already rejects JUST_WORKS/JUST_CFM when
pending_sec_level >= BT_SECURITY_HIGH, so letting tk_request() ignore the
local MITM requirement can make method selection inconsistent with the
policy the stack already enforces.

Only select JUST_CFM when the remote does not request MITM and the local
side does not require HIGH security. Otherwise, derive the method from
the IO capability table.

Fixes: 2b64d153a0cc ("Bluetooth: Add MITM mechanism to LE-SMP")
Cc: stable@vger.kernel.org
Suggested-by: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Signed-off-by: Oleh Konko <security@1seal.org>
---
 net/bluetooth/smp.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index e67bf7b34ea..a9fb9b513d6 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -863,13 +863,14 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth,
 	bt_dev_dbg(hcon->hdev, "auth:%u lcl:%u rem:%u", auth, local_io,
 		   remote_io);
 
-	/* If neither side wants MITM, either "just" confirm an incoming
-	 * request or use just-works for outgoing ones. The JUST_CFM
-	 * will be converted to JUST_WORKS if necessary later in this
-	 * function. If either side has MITM look up the method from the
-	 * table.
+	/* If the remote doesn't request MITM and the local side doesn't
+	 * require HIGH security, either "just" confirm an incoming request
+	 * or use just-works for outgoing ones. The JUST_CFM will be
+	 * converted to JUST_WORKS if necessary later in this function.
+	 * Otherwise, look up the method from the table.
 	 */
-	if (!(auth & SMP_AUTH_MITM))
+	if (!(auth & SMP_AUTH_MITM) &&
+	    hcon->pending_sec_level < BT_SECURITY_HIGH)
 		smp->method = JUST_CFM;
 	else
 		smp->method = get_auth_method(smp, local_io, remote_io);
-- 
2.50.0



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

end of thread, other threads:[~2026-04-01 19:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 11:52 [PATCH v4 0/2] Bluetooth: SMP: honor local MITM requirements for legacy pairing Oleh Konko
2026-03-31 11:52 ` [PATCH v4 1/2] Bluetooth: SMP: force responder MITM requirements before building the pairing response Oleh Konko
2026-03-31 13:25   ` Bluetooth: SMP: honor local MITM requirements for legacy pairing bluez.test.bot
2026-03-31 11:52 ` [PATCH v4 2/2] Bluetooth: SMP: derive legacy responder STK authentication from MITM state Oleh Konko
2026-04-01 19:10 ` [PATCH v4 0/2] Bluetooth: SMP: honor local MITM requirements for legacy pairing patchwork-bot+bluetooth
  -- strict thread matches above, loose matches on Subject: below --
2026-03-30 15:33 [PATCH v3 1/2] Bluetooth: SMP: honor local HIGH security when selecting legacy pairing method Oleh Konko
2026-03-30 16:25 ` Bluetooth: SMP: honor local MITM requirements for legacy pairing 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