[BUG] Bluetooth: ISO: BIG creation with 1M PHY fails on 0x203e and leaks active ext adv handle
From: Kelvin You
Date: Tue Nov 17 2026 - 21:34:17 EST
Hi,
I ran into two related issues when creating a broadcast ISO stream
(BTPROTO_ISO) with 1M PHY (BT_ISO_PHY_1M) on Linux 7.0.0-34-generic,
and checked that the same logic is still present in current upstream
net/bluetooth/hci_conn.c and net/bluetooth/hci_sync.c.
1. create_big_sync() triggers legacy advertising PDUs for 1M PHY
When setting up a BIG via BTPROTO_ISO with out.phys = BT_ISO_PHY_1M
(0x01), create_big_sync() in net/bluetooth/hci_conn.c only sets
MGMT_ADV_FLAG_SEC_2M when out.phys == BIT(1), leaving flags = 0 for 1M:
if (qos->bcast.out.phys == BIT(1))
flags |= MGMT_ADV_FLAG_SEC_2M;
That flags = 0 is passed into hci_start_per_adv_sync() ->
hci_start_ext_adv_sync() -> hci_setup_ext_adv_instance_sync().
Because (flags & MGMT_ADV_FLAG_SEC_MASK) is 0 and the advertising set
is non-connectable and non-scannable, hci_setup_ext_adv_instance_sync()
sets cp.evt_properties to LE_LEGACY_NONCONN_IND (0x0010).
The controller accepts LE Set Extended Advertising Parameters (0x2036)
with Properties=0x0010 and enables Handle 0x01 via LE Set Extended
Advertising Enable (0x2039), then rejects the immediately following
LE Set Periodic Advertising Parameters (0x203e) with Invalid HCI Command
Parameters (0x12), since periodic advertising is not allowed with
legacy advertising PDUs:
< HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036)
Handle: 0x01
Properties: 0x0010 (Use Legacy PDUs)
Primary PHY: LE 1M (0x01)
Secondary PHY: LE 1M (0x01)
SID: 0x00
> HCI Event: Command Complete (0x0e) - 0x2036: Success (0x00)
< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039)
Enable: 0x01, Handle: 0x01
> HCI Event: Command Complete (0x0e) - 0x2039: Success (0x00)
< HCI Command: LE Set Periodic Advertising Parameters (0x08|0x003e)
Handle: 0x01, Min/Max interval: 10 msec (0x0008), Properties: 0x0000
> HCI Event: Command Complete (0x0e) - 0x203e: Invalid HCI Command
Parameters (0x12)
dmesg logs:
Bluetooth: hci0: Opcode 0x203e failed: -22
Bluetooth: hci0: Unable to create BIG: -22
Using BT_ISO_PHY_2M on the same host and controller works as expected
because MGMT_ADV_FLAG_SEC_2M sets MGMT_ADV_FLAG_SEC_MASK and produces
Properties=0x0000 (extended non-connectable non-scannable).
2. hci_start_per_adv_sync() error path leaves ext adv handle enabled
After 0x203e fails above, hci_start_per_adv_sync() jumps to:
fail:
if (added)
hci_remove_adv_instance(hdev, instance);
Since hci_start_ext_adv_sync() already ran hci_enable_ext_advertising_sync(),
removing the in-kernel adv_info without disabling the advertising set in
the controller leaves Handle 0x01 active. Any subsequent attempt to create
a BIG (including with BT_ISO_PHY_2M) then fails on 0x2036 with Command
Disallowed (0x0c):
Bluetooth: hci0: Opcode 0x2036 failed: -16
Bluetooth: hci0: Unable to create BIG: -16
until an HCI reset.
Reproducer summary:
- Open an AF_BLUETOOTH / BTPROTO_ISO SOCK_SEQPACKET socket.
- setsockopt(SOL_BLUETOOTH, BT_ISO_QOS) with bcast.out.phys = 0x01
(BT_ISO_PHY_1M), interval = 10000, sdu = 600, rtn = 2, latency = 256.
- bind() to local BD_ADDR with bc_sid = 0, bc_num_bis = 1, bc_bis[0] = 1,
then connect() to BDADDR_ANY.
Expected behavior:
- create_big_sync() should set MGMT_ADV_FLAG_SEC_1M when 1M PHY is
requested (or when neither 2M nor Coded is selected) so
hci_setup_ext_adv_instance_sync() uses extended non-connectable PDUs
instead of LE_LEGACY_NONCONN_IND.
- hci_start_per_adv_sync() fail path should disable the extended
advertising instance before removing adv_info.
Regards,
Kelvin You