Re: [syzbot] [bluetooth?] WARNING in hci_connect_sco
From: Jeremy Dean Clifton
Date: Fri Oct 16 2026 - 15:57:00 EST
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1726,8 +1726,15 @@
}
cancel_delayed_work(&conn->disc_work);
- queue_delayed_work(conn->hdev->workqueue,
- &conn->disc_work, timeo);
+
+ /* Pairs with synchronize_rcu() in hci_dev_close_sync(): don't
+ * queue disc_work while hdev->workqueue is being drained.
+ */
+ rcu_read_lock();
+ if (!hci_dev_test_flag(conn->hdev, HCI_CMD_DRAIN_WORKQUEUE))
+ queue_delayed_work(conn->hdev->workqueue,
+ &conn->disc_work, timeo);
+ rcu_read_unlock();
}
}