Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v2 0/1] Bluetooth: fix stack OOB write in the legacy adv data path
@ 2026-11-10 17:53 Piyus Kedia
  2026-11-10 17:53 ` [PATCH v2 1/1] Bluetooth: hci_sync: drop adv instances the controller cannot carry Piyus Kedia
  0 siblings, 1 reply; 5+ messages in thread
From: Piyus Kedia @ 2026-11-10 17:53 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, Kapil Vaswani, Piyus Kedia

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-12 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10 17:53 [PATCH v2 0/1] Bluetooth: fix stack OOB write in the legacy adv data path Piyus Kedia
2026-11-10 17:53 ` [PATCH v2 1/1] Bluetooth: hci_sync: drop adv instances the controller cannot carry Piyus Kedia
2026-11-10 18:59   ` Bluetooth: fix stack OOB write in the legacy adv data path bluez.test.bot
2026-11-11 19:49   ` [PATCH v2 1/1] Bluetooth: hci_sync: drop adv instances the controller cannot carry Luiz Augusto von Dentz
2026-11-12 12:57     ` Piyus Kedia

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