mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Bluetooth: Fix advertising instance accesses without hdev->lock
@ 2026-11-19  0:32 Cen Zhang
  2026-11-19  0:32 ` [PATCH v2 1/2] Bluetooth: hci_sync: Fix remaining advertising instance UAFs Cen Zhang
  2026-11-19  0:32 ` [PATCH v2 2/2] Bluetooth: hci_sync: Use controller handles for periodic advertising Cen Zhang
  0 siblings, 2 replies; 3+ messages in thread
From: Cen Zhang @ 2026-11-19  0:32 UTC (permalink / raw)
  To: marcel, luiz.dentz
  Cc: linux-bluetooth, linux-kernel, baijiaju1990, jjzuming, zzzccc427

Snapshot advertising instance data under hdev->lock and keep instance
numbers, rather than list pointers, while waiting for controller commands
(patch 1). The resume and power-on walks use a 255-byte stack array in
list order, covering every nonzero u8 instance ID without an allocation
failure after the pause state has been consumed. Widen the timeout
conversion before converting to 10 ms units and clamp to U16_MAX.

Translate management instance numbers to controller handles in the
remaining periodic advertising, BIG creation and advertising set
transfer commands. For the shared handle 0, update the intended instance
after the command succeeds, since the completion has no instance number
(patch 2). The remove-set and random-address paths have already been
fixed in the current tree and keep those implementations.

The former patch 2, "Bluetooth: hci_core: Initialize advertising RPA work
only once", is already applied upstream and is not included again.

Validation: GCC modular and Clang built-in Bluetooth builds, including
Clang context analysis; every prefix of both revised series and their
combined tree build on bluetooth-next f42f5cae154b.
No new kernel runtime test was run; the quoted report is from the earlier
instrumented test kernel.

I used Codex (OpenAI) to help write these patches.

Cen Zhang (2):
  Bluetooth: hci_sync: Fix remaining advertising instance UAFs
  Bluetooth: hci_sync: Use controller handles for periodic advertising

 net/bluetooth/hci_sync.c | 343 ++++++++++++++++++++++++++++++---------
 net/bluetooth/mgmt.c     |  34 +++-
 2 files changed, 292 insertions(+), 85 deletions(-)

---
Changes in v2:
- Address the advertising snapshot allocation and timeout/handle concerns
  raised by Sashiko:
  https://netdev-ai.bots.linux.dev/sashiko/#/patchset/pm-bluetooth-objects-candidate-0245-v9-6b34bc036455ad3dd4ea-0%40gmail.com
- Use a 255-byte stack array in list order, and widen and clamp the duration
  conversion.
- Add a separate periodic/BIG/transfer handle mapping fix; retain the
  remove-set and random-address fixes already in next.
- Drop the former patch 2, Initialize advertising RPA work only once,
  because it is already applied upstream.
- Rebase onto bluetooth-next f42f5cae154b; preserve the connection-work
  shutdown changes.

Link to v1: https://lore.kernel.org/r/pm-bluetooth-objects-candidate-0245-v9-6b34bc036455ad3dd4ea-0@gmail.com

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

end of thread, other threads:[~2026-11-19  0:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19  0:32 [PATCH v2 0/2] Bluetooth: Fix advertising instance accesses without hdev->lock Cen Zhang
2026-11-19  0:32 ` [PATCH v2 1/2] Bluetooth: hci_sync: Fix remaining advertising instance UAFs Cen Zhang
2026-11-19  0:32 ` [PATCH v2 2/2] Bluetooth: hci_sync: Use controller handles for periodic advertising Cen Zhang

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

all inboxes | Powered by JetHome®