Skip to contentSkip to conversation

Bluetooth: hci_sync: Fix using random address for BIG/PA advertisements

PATCH Applied Luiz Augusto von Dentz 3 participants 3 messages Sep 19, 2025 – Sep 23, 2025

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: hci_sync: Fix using random address for BIG/PA advertisements

From: Luiz Augusto von Dentz <[email protected]>

When creating an advertisement for BIG the address shall not be non-resolvable since in case of acting as BASS/Broadcast Assistant the address must be the same as the connection in order to use the PAST method and even when PAST/BASS are not in the picture a PA can still be synchronized thus the same argument as to connectable advertisements still stand.

Fixes eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
---
 net/bluetooth/hci_sync.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/bluetooth/hci_sync.c +6 -4
index 6a0f731615f2..7f4310dc804c 100644
@@ -1325,7 +1325,7 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
 {
 	struct hci_cp_le_set_ext_adv_params cp;
 	struct hci_rp_le_set_ext_adv_params rp;
-	bool connectable;
+	bool connectable, require_privacy;
 	u32 flags;
 	bdaddr_t random_addr;
 	u8 own_addr_type;
@@ -1363,10 +1363,12 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
 		return -EPERM;
 
 	/* Set require_privacy to true only when non-connectable
-	 * advertising is used. In that case it is fine to use a
-	 * non-resolvable private address.
+	 * advertising is used and it is not periodic.
+	 * In that case it is fine to use a non-resolvable private address.
 	 */
-	err = hci_get_random_address(hdev, !connectable,
+	require_privacy = !connectable && !(adv && adv->periodic);
+
+	err = hci_get_random_address(hdev, require_privacy,
 				     adv_use_rpa(hdev, flags), adv,
 				     &own_addr_type, &random_addr);
 	if (err < 0)
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw

Dear Luiz,

Thank you for your patch.

Am 19.09.25 um 18:30 schrieb Luiz Augusto von Dentz:

Quoted 6 lines

From: Luiz Augusto von Dentz <[email protected]>

When creating an advertisement for BIG the address shall not be non-resolvable since in case of acting as BASS/Broadcast Assistant the address must be the same as the connection in order to use the PAST method and even when PAST/BASS are not in the picture a PA can still be

PA = Periodic Advertisement

Quoted 2 lines

synchronized thus the same argument as to connectable advertisements still stand.

stand*s*

Quoted 1 line
Fixes eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")

Just for the record, that entered Linux in 6.0-rc1.

Quoted 24 lines
---
  net/bluetooth/hci_sync.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
net/bluetooth/hci_sync.c +1 -3
index 6a0f731615f2..7f4310dc804c 100644
@@ -1325,7 +1325,7 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
  {
  	struct hci_cp_le_set_ext_adv_params cp;
  	struct hci_rp_le_set_ext_adv_params rp;
-	bool connectable;
+	bool connectable, require_privacy;
  	u32 flags;
  	bdaddr_t random_addr;
  	u8 own_addr_type;
@@ -1363,10 +1363,12 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
  		return -EPERM;
 
  	/* Set require_privacy to true only when non-connectable
-	 * advertising is used. In that case it is fine to use a
-	 * non-resolvable private address.

net/bluetooth/hci_sync.c int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance) · line 1374

Quoted 10 lines
net/bluetooth/hci_sync.c +5 -1
+	 * advertising is used and it is not periodic.
+	 * In that case it is fine to use a non-resolvable private address.
  	 */
-	err = hci_get_random_address(hdev, !connectable,
+	require_privacy = !connectable && !(adv && adv->periodic);
+
+	err = hci_get_random_address(hdev, require_privacy,
  				     adv_use_rpa(hdev, flags), adv,
  				     &own_addr_type, &random_addr);
  	if (err < 0)

Kind regards,

Paul

#2 lore raw
In reply to Luiz Augusto von Dentz
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 10 lines · On Fri, 19 Sep 2025 12:30:05 -0400 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

When creating an advertisement for BIG the address shall not be non-resolvable since in case of acting as BASS/Broadcast Assistant the address must be the same as the connection in order to use the PAST method and even when PAST/BASS are not in the picture a PA can still be synchronized thus the same argument as to connectable advertisements still stand.

[...]

Here is the summary with links:
- [v1] Bluetooth: hci_sync: Fix using random address for BIG/PA advertisements

    https://git.kernel.org/bluetooth/bluetooth-next/c/cf9eb0b9f620

You are awesome, thank you!

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