Re: [PATCH] Bluetooth: hci_sysfs: Fix NULL pointer dereference in device_del()
From: patchwork-bot+bluetooth
Date: Fri Sep 04 2026 - 13:17:20 EST
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>:
On Fri, 4 Sep 2026 12:24:22 +0000 (UTC) you wrote:
> From: Krystian Kaniewski <krystianmkaniewski@xxxxxxxxx>
>
> A NULL pointer dereference in klist_put() occurs when a child device (such
> as a BNEP network device in bnep_session) is concurrently being
> unregistered while hci_conn_del_sysfs() reparents child devices.
>
> This is caused by a race condition between hci_conn_del_sysfs() and
> concurrent child device unregistration (e.g. bnep_session calling
> unregister_netdev()). During device unregistration, device_del() snapshots
> a non-NULL parent pointer. Concurrently, hci_conn_del_sysfs() finds the
> child device using device_find_any_child() and calls device_move() to
> reparent it to NULL, which removes the node from its parent's klist and
> clears knode_parent. Subsequently, device_del() calls
> klist_del(&dev->p->knode_parent) using the stale parent snapshot, causing
> klist_put() to dereference knode_klist(n)->put on an already removed node,
> resulting in a NULL pointer dereference.
>
> [...]
Here is the summary with links:
- Bluetooth: hci_sysfs: Fix NULL pointer dereference in device_del()
https://git.kernel.org/bluetooth/bluetooth-next/c/21c3501e5f46
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html