]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Bluetooth: mgmt: fix locking in unpair_device/disconnect_sync
authorPauli Virtanen <pav@iki.fi>
Fri, 10 Jul 2026 08:23:41 +0000 (11:23 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 13 Jul 2026 14:08:46 +0000 (10:08 -0400)
commit16cd66443957e4ad42155c6fec401012f600c6f8
treeb42bdeb6ecb44af7018b43eaf7dbd7c260106e1f
parentd5efd6e4b8b0634af6843178fe1a7dd2b2178a3d
Bluetooth: mgmt: fix locking in unpair_device/disconnect_sync

Dereferencing RCU-protected pointers outside critical sections is
invalid and may lead to UAF.

Take hdev->lock for hci_conn lookup and hci_abort_conn().  Don't use RCU
to ensure the conn is fully initialized at this point.

Fixes: 227a0cdf4a028 ("Bluetooth: MGMT: Fix not generating command complete for MGMT_OP_DISCONNECT")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c