mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net 0/2] Bluetooth: Serialize TX scheduling with teardown
@ 2026-09-26 17:04 Chengfeng Ye
  2026-09-26 17:04 ` [PATCH net 1/2] Bluetooth: hci_core: Serialize ACL scheduling with channel deletion Chengfeng Ye
  2026-09-26 17:04 ` [PATCH net 2/2] Bluetooth: hci_core: Serialize SCO and ISO scheduling with teardown Chengfeng Ye
  0 siblings, 2 replies; 3+ messages in thread
From: Chengfeng Ye @ 2026-09-26 17:04 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Gustavo Padovan
  Cc: linux-bluetooth, linux-kernel, Chengfeng Ye

The TX scheduler drops its RCU read lock before using the selected channel
or connection. Teardown on the separate request workqueue can then free
that object while transmission is still using it.

This series fixes two distinct lifetime bugs using the existing device
mutex:

  1. Protect channel selection, transmission and priority recalculation
     in the ACL and LE schedulers against channel deletion.
  2. Protect connection selection and transmission in the SCO and ISO
     schedulers against connection teardown.

Please apply the patches in order. Patch 2 depends on the ACL/LE locking
introduced by patch 1: it uses a lock-held SCO helper for their nested SCO
calls, while direct SCO calls from the TX worker use a locking wrapper.
This preserves packet scheduling order without recursively taking the
device mutex. Timeout checks remain outside the critical sections.

The transmit path can sleep, so extending ordinary RCU across transmission
is not a suitable substitute for the mutex.

Validation: rebuilt hci_core.o after each patch and completed a full kernel
build with CONFIG_BT, CONFIG_BT_BREDR and CONFIG_BT_LE enabled. Both patches
pass strict checkpatch and apply in order to the stated base. Runtime PoC
replay and runtime lockdep testing have not been performed for this series.

Chengfeng Ye (2):
  Bluetooth: hci_core: Serialize ACL scheduling with channel deletion
  Bluetooth: hci_core: Serialize SCO and ISO scheduling with teardown

 net/bluetooth/hci_core.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)


base-commit: 165768bb70265b5c38cf0b73fafd75be235f8b14
-- 
2.43.0

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

end of thread, other threads:[~2026-09-26 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-26 17:04 [PATCH net 0/2] Bluetooth: Serialize TX scheduling with teardown Chengfeng Ye
2026-09-26 17:04 ` [PATCH net 1/2] Bluetooth: hci_core: Serialize ACL scheduling with channel deletion Chengfeng Ye
2026-09-26 17:04 ` [PATCH net 2/2] Bluetooth: hci_core: Serialize SCO and ISO scheduling with teardown Chengfeng Ye

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®