Linux bluetooth development
 help / color / mirror / Atom feed
* [Bug 222359] New: Bluetooth: MGMT Set Public Address in the post-setup auto-off window succeeds but leaves the controller hidden with HCI_CONFIG set
@ 2026-12-03  7:51 bugzilla-daemon
  0 siblings, 0 replies; only message in thread
From: bugzilla-daemon @ 2026-12-03  7:51 UTC (permalink / raw)
  To: linux-bluetooth

https://bugzilla.kernel.org/show_bug.cgi?id=222359

            Bug ID: 222359
           Summary: Bluetooth: MGMT Set Public Address in the post-setup
                    auto-off window succeeds but leaves the controller
                    hidden with HCI_CONFIG set
           Product: Drivers
           Version: 2.5
    Kernel Version: 7.3.7-2-cachyos
          Hardware: AMD
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Bluetooth
          Assignee: linux-bluetooth@vger.kernel.org
          Reporter: bugzilla@accelocom.com
        Regression: No

MGMT Set Public Address is accepted while the controller is in the post-setup
auto-off window (HCI_UP + HCI_AUTO_OFF), because hdev_is_powered() treats that
state as off. It reports success, but the address is never applied and the
index is never re-added, so the controller stays hidden from mgmt until the
driver is reloaded.

Why (mainline master as of 2026-12-02):
1. set_public_address() calls mgmt_index_removed(), sets HCI_CONFIG and
HCI_AUTO_OFF, and queues power_on.
2. hci_power_on() takes its HCI_UP && HCI_MGMT && HCI_AUTO_OFF fast path:
hci_powered_update_sync(), then return.
3. So hci_dev_do_open() never runs (set_bdaddr is never called), HCI_CONFIG is
never cleared, and mgmt_index_added() is never called.

Observed (hit at boot by a systemd unit running btmgmt public-addr before
bluetoothd started): the command returns success; btmgmt info then lists 0
indexes; hci0 is UP and RUNNING with HCI_CONFIG set, bdaddr still the old
address and public_addr the new one (read with bpftrace). Reloading btusb
recovers Bluetooth functionality. The same command works when the controller is
fully closed.

To reproduce (worked out from the above, not yet run as a standalone test):
stop bluetoothd, reload btusb, and within 2 seconds of hci0 appearing run
"btmgmt --index 0 public-addr <addr>".

Possible fixes: reject in set_public_address() whenever HCI_UP is set, or skip
the hci_power_on() fast path when HCI_CONFIG is set.

Environment: MediaTek MT7927 (btusb + btmtk), kernel 7.3.7-2-cachyos, BlueZ
5.88.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-03  7:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  7:51 [Bug 222359] New: Bluetooth: MGMT Set Public Address in the post-setup auto-off window succeeds but leaves the controller hidden with HCI_CONFIG set bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox