[PATCH v2 0/1] Bluetooth: fix stack OOB write in the legacy adv data path
From: Piyus Kedia
Date: Tue Nov 10 2026 - 12:58:42 EST
Hi,
We would like to follow up on the stack out-of-bounds writes in
eir_create_adv_data() and eir_create_scan_rsp() we reported earlier.
The patch we suggested earlier bounded the copy in eir.c. As Luiz pointed
out, the stale advertising instance is the bug rather than the missing
bounds check, so this new patch unregisters instances that no longer fit
the controller's capability, at power-on, and reports them with
MGMT_EV_ADVERTISING_REMOVED. Userspace can add them again with the right
size.
Verified at runtime: with this patch applied, the reproducer completes
cleanly on both the adv_data and scan_rsp paths and the instance is
removed; without it KASAN reports a 220-byte write into the 31-byte
buffer at eir.c:303 and eir.c:360. The tree it was verified on has
net/bluetooth/eir.c and hci_powered_update_adv_sync() byte-identical to
this base.
Apologies for the form of our earlier submission: it was a bug report
that patchwork picked up as a patch, which is why the whole report ended
up as the commit message.
Link to v1: https://patchwork.kernel.org/series/1206772/
Thanks and regards,
Piyus Kedia
Kapil Vaswani
Piyus Kedia (1):
Bluetooth: hci_sync: drop adv instances the controller cannot carry
net/bluetooth/hci_sync.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
--
2.34.1