Skip to contentSkip to conversation

Bluetooth: hci_sync: Sync to an RPA broadcaster without its IRK

PATCH Applied Simon Mikuda 3 participants 3 messages Nov 22 – Nov 23

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: hci_sync: Sync to an RPA broadcaster without its IRK

hci_le_pa_create_sync() waits for an extended advertising report of the broadcaster to learn its SID, and while HCI_PA_SYNC is set the passive scan filters on an accept list that holds only the broadcaster's address. hci_update_accept_list_sync() then enables address resolution as for any other accept list. A broadcaster that advertises from an RPA nobody has the IRK for cannot be resolved, and a Synaptics controller drops its reports at that point instead of matching the address as it is against the accept list. No report reaches the host, and the PA sync times out although the broadcaster is in range.

Leave address resolution disabled while the accept list holds a PA sync target that is an RPA the host has no IRK for. Such a broadcaster can only be found by the address it advertises from anyway. A broadcaster known by its identity address, which a bonded one is, still needs resolution and keeps it. Resolution comes back with the next accept list update.

This needs no quirk, because it costs nothing on a controller that matches such an RPA as it is. The resolving list cannot resolve the target, and the accept list drops the reports of every other device with or without resolution. Nothing else needs resolution in that
window: hci_le_pa_create_sync() holds the cmd_sync queue until the sync is established or times out, so no LE connection is created, and le_conn_complete_evt() maps the RPA of an incoming connection to its identity in the host.

Own advertising is resumed with resolution off. The stack already advertises that way: hci_pause_addr_resolution() keeps advertising paused during an active scan while the host uses an RPA, but hci_stop_discovery_sync() resumes it before the next accept list update enables resolution again. It works because with privacy the host programs the set's random address with an RPA from the same local IRK, and own address type 0x03 falls back to that address when the controller does not generate one from the resolving list.

Steps to reproduce:
1. On a Synaptics controller with LL privacy support, listen for a broadcaster that advertises from an RPA and is not bonded.
2. The PA sync times out with no advertising report of the broadcaster.

Fixes bba71ef13b20 ("Bluetooth: hci_sync: Use address filtering when HCI_PA_SYNC is set")
---
 net/bluetooth/hci_sync.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
net/bluetooth/hci_sync.c +17 -3
index 638589f77081..1a920cd83df1 100644
@@ -3216,6 +3216,7 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 	struct conn_params *params;
 	u8 num_entries = 0;
 	bool pend_conn, pend_report;
+	bool resolve = true;
 	u8 filter_policy;
 	size_t i, n;
 	int err;
@@ -3258,6 +3259,16 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 
 			rcu_read_unlock();
 
+			/* With address resolution enabled, a controller may
+			 * drop the advertising reports of an RPA it has no IRK
+			 * for instead of matching the address as it is against
+			 * the accept list. The SID the PA sync waits for then
+			 * never arrives. Match a broadcaster without an IRK by
+			 * the address it advertises from.
+			 */
+			resolve = !hci_bdaddr_is_rpa(&pa.addr, pa.addr_type) ||
+				  hci_find_irk_by_rpa(hdev, &pa.addr);
+
 			/* Clear first since there could be addresses left
 			 * behind.
 			 */
@@ -3383,9 +3394,12 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 	filter_policy = err ? 0x00 : 0x01;
 
 	/* Enable address resolution when LL Privacy is enabled. */
-	err = hci_le_set_addr_resolution_enable_sync(hdev, 0x01);
-	if (err)
-		bt_dev_err(hdev, "Unable to enable LL privacy: %d", err);
+	if (resolve) {
+		err = hci_le_set_addr_resolution_enable_sync(hdev, 0x01);
+		if (err)
+			bt_dev_err(hdev, "Unable to enable LL privacy: %d",
+				   err);
+	}
 
 	/* Resume advertising if it was paused */
 	if (ll_privacy_capable(hdev))

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96

Signature · 1 line
2.43.0
#1 lore raw

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

---Test result---

Test Summary:

CheckPatch                    PASS      0.62 seconds
VerifyFixes                   PASS      0.11 seconds
VerifySignedoff               PASS      0.10 seconds
GitLint                       PASS      0.29 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      24.76 seconds
CheckAllWarning               PASS      28.36 seconds
CheckSparse                   PASS      29.69 seconds
BuildKernel32                 PASS      24.72 seconds
CheckKernelLLVM               PASS      24.63 seconds
TestRunnerSetup               PASS      584.80 seconds
TestRunner_l2cap-tester       PASS      15.48 seconds
TestRunner_iso-tester         PASS      13.71 seconds
TestRunner_bnep-tester        PASS      2.89 seconds
TestRunner_mgmt-tester        PASS      85.66 seconds
TestRunner_rfcomm-tester      PASS      4.13 seconds
TestRunner_sco-tester         PASS      5.19 seconds
TestRunner_ioctl-tester       PASS      4.27 seconds
TestRunner_mesh-tester        PASS      4.18 seconds
TestRunner_smp-tester         PASS      4.04 seconds
TestRunner_userchan-tester    PASS      2.95 seconds
TestRunner_6lowpan-tester     PASS      4.11 seconds
IncrementalBuild              PASS      22.65 seconds

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

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Simon Mikuda
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 11 lines · On Sun, 22 Nov 2026 21:13:33 +0100 you wrote:

hci_le_pa_create_sync() waits for an extended advertising report of the broadcaster to learn its SID, and while HCI_PA_SYNC is set the passive scan filters on an accept list that holds only the broadcaster's address. hci_update_accept_list_sync() then enables address resolution as for any other accept list. A broadcaster that advertises from an RPA nobody has the IRK for cannot be resolved, and a Synaptics controller drops its reports at that point instead of matching the address as it is against the accept list. No report reaches the host, and the PA sync times out although the broadcaster is in range.

[...]

Here is the summary with links:
- Bluetooth: hci_sync: Sync to an RPA broadcaster without its IRK

    https://git.kernel.org/bluetooth/bluetooth-next/c/02466e0aeba6

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html