* [PATCH] Bluetooth: keep dst_type with dst when reusing an LE connection
@ 2026-09-07 23:20 Radek Podgorny
2026-09-08 16:05 ` bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Radek Podgorny @ 2026-09-07 23:20 UTC (permalink / raw)
To: Marcel Holtmann, Luiz Augusto von Dentz
Cc: linux-bluetooth, linux-kernel, Radek Podgorny, stable
hci_connect_le() swaps the caller's identity address for the peer's
cached RPA when one is known, and stamps the matching
ADDR_LE_DEV_RANDOM on the local dst_type. On the conn-reuse path only
the address is copied into the connection:
if (conn) {
bacpy(&conn->dst, dst);
so conn->dst ends up holding an RPA while conn->dst_type still names the
identity it was resolved from, and hci_le_create_conn_sync() puts that
pair on air unchanged. An RPA declared as a public address is not
something any peer can answer.
Measured on a CYW43438 against a peer advertising an RPA the host holds
the IRK for, connecting to the identity address over a raw L2CAP socket.
The first attempt creates the connection, the second takes the reuse
path:
LE Create Connection 3C:78:95:78:37:C3 type public
LE Create Connection 5B:75:A2:26:D6:18 type public
LE Connection Complete: Unknown Connection Identifier (0x02)
The second address is the peer's RPA. btmon annotates it with an OUI
lookup rather than "(Resolvable)" precisely because the command declares
it public; the same bit pattern annotates as resolvable once the type is
right.
The mistyped pair is also why nothing downstream repairs it.
hci_bdaddr_is_rpa() tests the type before the address, so an RPA carrying
a public type is not recognised as one, and hci_find_irk_by_addr() then
searches for an identity address that does not match it either.
Copy the type along with the address.
The assignment used to be unconditional just below this block and covered
both paths; it moved into hci_conn_add_unset(), which the reuse path does
not go through.
Cc: stable@vger.kernel.org
Fixes: 14b06c3a88f7 ("Bluetooth: HCI: Always use the identity address when initializing a connection")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Radek Podgorny <radek@podgorny.cz>
---
net/bluetooth/hci_conn.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 8de98af2fb58..5fcd85a00de8 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1505,7 +1505,15 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
}
if (conn) {
+ /* dst may just have been swapped for the peer's RPA above, and
+ * dst_type describes dst -- it has to travel with it. Leaving
+ * the identity type behind makes the pair describe a peer that
+ * does not exist, and nothing downstream repairs it:
+ * hci_bdaddr_is_rpa() tests the type before the address, so
+ * the RPA is never treated as one.
+ */
bacpy(&conn->dst, dst);
+ conn->dst_type = dst_type;
} else {
conn = hci_conn_add_unset(hdev, LE_LINK, dst, dst_type, role);
if (IS_ERR(conn))
base-commit: 755cf7adf8dd2d12627cb7de223d35b12228e2f5
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: Bluetooth: keep dst_type with dst when reusing an LE connection
2026-09-07 23:20 [PATCH] Bluetooth: keep dst_type with dst when reusing an LE connection Radek Podgorny
@ 2026-09-08 16:05 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-09-08 16:05 UTC (permalink / raw)
To: linux-bluetooth, radek
[-- Attachment #1: Type: text/plain, Size: 2645 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/1160053/
---Test result---
Test Summary:
CheckPatch PASS 0.73 seconds
VerifyFixes PASS 0.13 seconds
VerifySignedoff PASS 0.13 seconds
GitLint FAIL 0.33 seconds
SubjectPrefix PASS 0.12 seconds
BuildKernel PASS 29.20 seconds
CheckAllWarning PASS 32.20 seconds
CheckSparse PASS 30.40 seconds
BuildKernel32 PASS 27.77 seconds
CheckKernelLLVM SKIP 0.00 seconds
TestRunnerSetup PASS 526.26 seconds
TestRunner_l2cap-tester PASS 70.07 seconds
TestRunner_iso-tester PASS 106.21 seconds
TestRunner_bnep-tester PASS 20.56 seconds
TestRunner_mgmt-tester FAIL 236.58 seconds
TestRunner_rfcomm-tester PASS 27.26 seconds
TestRunner_sco-tester PASS 34.15 seconds
TestRunner_ioctl-tester PASS 27.81 seconds
TestRunner_mesh-tester FAIL 26.95 seconds
TestRunner_smp-tester PASS 24.61 seconds
TestRunner_userchan-tester PASS 21.29 seconds
TestRunner_6lowpan-tester PASS 24.19 seconds
IncrementalBuild PASS 27.23 seconds
Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
Bluetooth: keep dst_type with dst when reusing an LE connection
8: B3 Line contains hard tab characters (\t): " if (conn) {"
9: B3 Line contains hard tab characters (\t): " bacpy(&conn->dst, dst);"
##############################
Test: CheckKernelLLVM - SKIP
Desc: Build kernel with LLVM + context analysis
Output:
Clang not found
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 501, Passed: 496 (99.0%), Failed: 1, Not Run: 4
Failed Test Cases
Read Exp Feature - Success Failed 0.280 seconds
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0
Failed Test Cases
Mesh - Send cancel - 1 Timed out 2.457 seconds
Mesh - Send cancel - 2 Timed out 1.988 seconds
https://github.com/bluez/bluetooth-next/pull/716
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-08 16:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 23:20 [PATCH] Bluetooth: keep dst_type with dst when reusing an LE connection Radek Podgorny
2026-09-08 16:05 ` 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