diff options
| author | Aldo Ariel Panzardo <qwe.aldo@gmail.com> | 2026-09-15 12:59:52 -0300 |
|---|---|---|
| committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2026-09-16 13:51:34 -0400 |
| commit | b5dbb41b212c50c095a4dbee3017a84fe94f033b (patch) | |
| tree | 928065df1378aac0c1ad6f27be7cb920f3f967fa /tools/perf/scripts/python/stackcollapse.py | |
| parent | 6c78a213d9070b610c7f418af2c25b66180b7e37 (diff) | |
| download | linux-b5dbb41b212c50c095a4dbee3017a84fe94f033b.tar.gz linux-b5dbb41b212c50c095a4dbee3017a84fe94f033b.zip | |
Bluetooth: mgmt: fix race in read_unconf_index_list()
read_unconf_index_list() counts unconfigured controllers before allocating
its response, then checks the device flags again while filling it.
hci_dev_list_lock stabilizes list membership, but it does not serialize the
per-device flags. During asynchronous controller setup, the worker can set
HCI_UNCONFIGURED and clear HCI_SETUP between the two passes. A controller
omitted from the allocation count can then become eligible for the fill
pass, causing an out-of-bounds write to rp->index[].
Allocate space for every device on hci_dev_list. Since list membership
cannot change while hci_dev_list_lock is held, the response remains large
enough regardless of flag transitions. The reported count and response
length still include only eligible unconfigured controllers.
Fixes: 73d1df2a7a10 ("Bluetooth: Add support for Read Unconfigured Index List command")
Cc: stable@vger.kernel.org
Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
