Skip to contentSkip to conversation

shared/bass: Fix permissions not requiring encryption

PATCH Applied Luiz Augusto von Dentz 3 participants 4 messages Oct 2, 2025 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH v3 1/2 shared/bass: Fix permissions not requiring encryption

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

Both Broadcast Audio Scan Control Point and Broadcast Receive State do require encryption:

https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/24670-BASS-html5/out/en/index-en.html#UUID-dd95da9a-6ac0-3f45-7e34-13fa9e04d41c

---
 src/shared/bass.c | 4 ++--
 unit/test-bass.c  | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
src/shared/bass.c +2 -2
index f65e1eadca7f..36bb9ea66523 100644
@@ -1223,7 +1223,7 @@ static void bcast_recv_new(struct bt_bass_db *bdb, int i)
 	bt_uuid16_create(&uuid, BCAST_RECV_STATE_UUID);
 	bcast_recv_state->attr =
 		gatt_db_service_add_characteristic(bdb->service, &uuid,
-				BT_ATT_PERM_READ,
+				BT_ATT_PERM_READ | BT_ATT_PERM_READ_ENCRYPT,
 				BT_GATT_CHRC_PROP_READ |
 				BT_GATT_CHRC_PROP_NOTIFY,
 				bass_bcast_recv_state_read, NULL,
@@ -1252,7 +1252,7 @@ static void bass_new(struct bt_bass_db *bdb)
 	bdb->bcast_audio_scan_cp =
 		gatt_db_service_add_characteristic(bdb->service,
 				&uuid,
-				BT_ATT_PERM_WRITE,
+				BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_ENCRYPT,
 				BT_GATT_CHRC_PROP_WRITE |
 				BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP,
 				NULL, bass_bcast_audio_scan_cp_write,
unit/test-bass.c +1 -0
index 89835698e0a0..8d914cffa730 100644
@@ -653,6 +653,7 @@ static void test_server(const void *user_data)
 	att = bt_att_new(io_get_fd(io), false);
 	g_assert(att);
 
+	bt_att_set_security(att, BT_ATT_SECURITY_MEDIUM);
 	bt_att_set_debug(att, BT_ATT_DEBUG, print_debug, "bt_att:", NULL);
 
 	data->db = gatt_db_new();
Signature · 1 line
2.51.0
author maintainer
#1 lore raw

PATCH v3 2/2 client/player: Set QoS.Encryption if QoS.BCode is set

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

QoS.Encryption must be set in order for the daemon to interpret the QoS.BCode as valid.

---
 client/player.c | 4 ++++
 1 file changed, 4 insertions(+)
client/player.c +4 -0
index 598ad7f6dfd7..bb193dafeba0 100644
@@ -1870,6 +1870,10 @@ static void append_bcast_qos(DBusMessageIter *iter, struct endpoint_config *cfg)
 
 	if (cfg->ep->bcode->iov_len != 0) {
 		const char *key = "BCode";
+		uint8_t encryption = 0x01;
+
+		g_dbus_dict_append_entry(iter, "Encryption", DBUS_TYPE_BYTE,
+						&encryption);
 
 		bt_shell_printf("BCode:\n");
 		bt_shell_hexdump(cfg->ep->bcode->iov_base,
Signature · 1 line
2.51.0
#2 lore raw
In reply to Luiz Augusto von Dentz
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

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

Quoted 8 lines · On Thu, 2 Oct 2025 11:58:54 -0400 you wrote:

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

Both Broadcast Audio Scan Control Point and Broadcast Receive State do require encryption:

https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/24670-BASS-html5/out/en/index-en.html#UUID-dd95da9a-6ac0-3f45-7e34-13fa9e04d41c

[...]

Here is the summary with links:
- [BlueZ,v3,1/2] shared/bass: Fix permissions not requiring encryption

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=faca31657e1b
  - [BlueZ,v3,2/2] client/player: Set QoS.Encryption if QoS.BCode is set
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=3e55476bf6c8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#3 lore raw
In reply to Luiz Augusto von Dentz

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/project/bluetooth/list/?series=1008056

---Test result---

Test Summary:

CheckPatch                    PENDING   0.30 seconds
GitLint                       PENDING   0.34 seconds
BuildEll                      PASS      20.31 seconds
BluezMake                     PASS      2776.52 seconds
MakeCheck                     PASS      20.47 seconds
MakeDistcheck                 PASS      188.77 seconds
CheckValgrind                 PASS      242.47 seconds
CheckSmatch                   PASS      311.37 seconds
bluezmakeextell               PASS      129.77 seconds
IncrementalBuild              PENDING   0.20 seconds
ScanBuild                     PASS      929.69 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth