Re: [syzbot] [bluetooth?] WARNING in l2cap_do_send (2)

From: Hillf Danton
Date: Wed Dec 27 2023 - 06:53:06 EST


On Tue, 26 Dec 2023 14:54:27 -0800
> HEAD commit: fbafc3e621c3 Merge tag 'for_linus' of git://git.kernel.org..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14125c81e80000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

--- x/net/bluetooth/hci_core.c
+++ y/net/bluetooth/hci_core.c
@@ -3237,7 +3237,13 @@ void hci_send_acl(struct hci_chan *chan,

hci_queue_acl(chan, &chan->data_q, skb, flags);

- queue_work(hdev->workqueue, &hdev->tx_work);
+ rcu_read_lock();
+ if (test_bit(HCI_RESET, &hdev->flags) ||
+ hci_dev_test_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE))
+ ;
+ else
+ queue_work(hdev->workqueue, &hdev->tx_work);
+ rcu_read_unlock();
}

/* Send SCO data */
--