Re: [PATCH] Bluetooth: hci_sock: Serialize dead-device detachment
From: patchwork-bot+bluetooth
Date: Tue Oct 06 2026 - 10:30:27 EST
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>:
On Mon, 5 Oct 2026 00:24:42 +0800 you wrote:
> Rebinding an HCI socket after its controller is unregistered can race
> monitor control replay and crash the kernel. hci_sock_bind() clears
> hci_pi(sk)->hdev and drops the device reference under only the socket
> lock, whereas send_monitor_control_replay() holds hci_sk_list.lock for
> reading.
>
> Replay can observe a non-NULL hdev, then bind can clear it and drop the
> last reference before create_monitor_ctrl_open() reads hdev->id. This
> can cause a NULL pointer dereference if the pointer is reloaded, or a
> use-after-free if the old pointer is retained.
>
> [...]
Here is the summary with links:
- Bluetooth: hci_sock: Serialize dead-device detachment
https://git.kernel.org/bluetooth/bluetooth-next/c/381a0925c556
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html