From: Chengfeng Ye <nicoyip.dev@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
Gustavo Padovan <padovan@profusion.mobi>
Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
Chengfeng Ye <nicoyip.dev@gmail.com>
Subject: [PATCH net 0/2] Bluetooth: Serialize TX scheduling with teardown
Date: Sun, 27 Sep 2026 01:04:01 +0800 [thread overview]
Message-ID: <cover.1790407061.git.nicoyip.dev@gmail.com> (raw)
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
next reply other threads:[~2026-09-26 17:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-26 17:04 Chengfeng Ye [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1790407061.git.nicoyip.dev@gmail.com \
--to=nicoyip.dev@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=padovan@profusion.mobi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®