Re: [syzbot] [bluetooth?] KASAN: slab-use-after-free Read in mgmt_pending_remove

From: Edward Adam Davis
Date: Sun Nov 16 2025 - 03:02:58 EST


#syz test

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 262bf984d2aa..33e725798c34 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -9474,7 +9474,9 @@ void mgmt_index_removed(struct hci_dev *hdev)
if (hci_test_quirk(hdev, HCI_QUIRK_RAW_DEVICE))
return;

+ hci_dev_lock(hdev);
mgmt_pending_foreach(0, hdev, true, cmd_complete_rsp, &match);
+ hci_dev_unlock(hdev);

if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) {
mgmt_index_event(MGMT_EV_UNCONF_INDEX_REMOVED, hdev, NULL, 0,