From: patchwork-bot+bluetooth@kernel.org
To: Siwei Zhang <oss@fourdim.xyz>
Cc: luiz.dentz@gmail.com, pav@iki.fi, xiaowu.417@qq.com,
linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v6 1/2] Bluetooth: hci_conn: Fix null ptr deref in hci_abort_conn()
Date: Mon, 22 Jun 2026 17:00:19 +0000 [thread overview]
Message-ID: <178214761929.1322955.16732313923860679614.git-patchwork-notify@kernel.org> (raw)
In-Reply-To: <20260615153527.1583705-1-oss@fourdim.xyz>
Hello:
This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Mon, 15 Jun 2026 11:33:05 -0400 you wrote:
> hci_abort_conn() read hci_skb_event(hdev->sent_cmd) when a connection
> was pending, but hdev->sent_cmd can be NULL while req_status is still
> HCI_REQ_PEND, leading to a NULL pointer dereference and a general
> protection fault from the hci_rx_work() receive path.
>
> Instead of inspecting hdev->sent_cmd, track the in-flight create
> connection command with a new per-connection HCI_CONN_CREATE flag and
> route all cancellation through hci_cancel_connect_sync(), which
> dispatches to a dedicated per-type cancel function. The create command
> is in exactly one of two states: still queued, or in flight. The cancel
> function holds cmd_sync_work_lock across the whole decision: the worker
> takes this lock to dequeue every entry, so while it is held a queued
> command cannot start running and an in-flight command cannot complete
> and let the next command become pending. This keeps the flag test and
> hci_cmd_sync_cancel() atomic with respect to the worker, so a queued
> command is simply dequeued, and an in-flight command owned by this
> connection is cancelled without the risk of cancelling an unrelated
> command that became pending in the meantime. CIS uses the same flag
> mechanism via HCI_CONN_CREATE_CIS but cannot be dequeued per-connection.
>
> [...]
Here is the summary with links:
- [v6,1/2] Bluetooth: hci_conn: Fix null ptr deref in hci_abort_conn()
https://git.kernel.org/bluetooth/bluetooth-next/c/76c2d047410b
- [v6,2/2] Bluetooth: hci_sync: Remove unused hci_cmd_sync_dequeue_once()
https://git.kernel.org/bluetooth/bluetooth-next/c/8047d832767f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
prev parent reply other threads:[~2026-06-22 17:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 15:33 [PATCH v6 1/2] Bluetooth: hci_conn: Fix null ptr deref in hci_abort_conn() Siwei Zhang
2026-06-15 15:33 ` [PATCH v6 2/2] Bluetooth: hci_sync: Remove unused hci_cmd_sync_dequeue_once() Siwei Zhang
2026-06-15 17:04 ` [v6,1/2] Bluetooth: hci_conn: Fix null ptr deref in hci_abort_conn() bluez.test.bot
2026-06-16 15:33 ` Siwei Zhang
2026-06-22 17:00 ` patchwork-bot+bluetooth [this message]
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=178214761929.1322955.16732313923860679614.git-patchwork-notify@kernel.org \
--to=patchwork-bot+bluetooth@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=oss@fourdim.xyz \
--cc=pav@iki.fi \
--cc=xiaowu.417@qq.com \
/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