BUG: sleeping function called from invalid context at net/core/sock.c:3487 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3562, name: kworker/u5:8 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 6 locks held by kworker/u5:8/3562: #0: ffff88805ed3c938 ((wq_completion)hci3#2){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267 #1: ffffc90003c8fd20 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267 #2: ffff88807996c078 (&hdev->lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0xaa/0xac0 net/bluetooth/hci_event.c:5021 #3: ffffffff8e3f0f48 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1790 [inline] #3: ffffffff8e3f0f48 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0x4d5/0xac0 net/bluetooth/hci_event.c:5107 #4: ffff888019f3ec20 (&conn->lock#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] #4: ffff888019f3ec20 (&conn->lock#2){+.+.}-{2:2}, at: sco_conn_ready net/bluetooth/sco.c:1278 [inline] #4: ffff888019f3ec20 (&conn->lock#2){+.+.}-{2:2}, at: sco_connect_cfm+0x279/0xb10 net/bluetooth/sco.c:1363 #5: ffff8880739fa130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1748 [inline] #5: ffff8880739fa130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_ready net/bluetooth/sco.c:1291 [inline] #5: ffff8880739fa130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_connect_cfm+0x450/0xb10 net/bluetooth/sco.c:1363 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 3562 Comm: kworker/u5:8 Not tainted 6.1.100-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: hci3 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 __might_resched+0x5cb/0x780 kernel/sched/core.c:9945 lock_sock_nested+0x59/0x100 net/core/sock.c:3487 lock_sock include/net/sock.h:1748 [inline] sco_conn_ready net/bluetooth/sco.c:1291 [inline] sco_connect_cfm+0x450/0xb10 net/bluetooth/sco.c:1363 hci_connect_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_sync_conn_complete_evt+0x54b/0xac0 net/bluetooth/hci_event.c:5107 hci_event_func net/bluetooth/hci_event.c:7539 [inline] hci_event_packet+0xa9d/0x1510 net/bluetooth/hci_event.c:7591 hci_rx_work+0x3cd/0xce0 net/bluetooth/hci_core.c:4129 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Bluetooth: hci3: link tx timeout Bluetooth: hci3: killing stalled connection 11:aa:aa:aa:aa:aa ============================= [ BUG: Invalid wait context ] 6.1.100-syzkaller #0 Tainted: G W ----------------------------- kworker/u5:8/3562 is trying to lock: ffff88807996c9b0 (&hdev->unregister_lock){+.+.}-{3:3}, at: hci_cmd_sync_submit+0x3b/0x2e0 net/bluetooth/hci_sync.c:702 other info that might help us debug this: context-{4:4} 3 locks held by kworker/u5:8/3562: #0: ffff88805ed3c938 ((wq_completion)hci3#2){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267 #1: ffffc90003c8fd20 ((work_completion)(&hdev->tx_work)){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267 #2: ffffffff8d12ad40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #2: ffffffff8d12ad40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #2: ffffffff8d12ad40 (rcu_read_lock){....}-{1:2}, at: hci_link_tx_to net/bluetooth/hci_core.c:3447 [inline] #2: ffffffff8d12ad40 (rcu_read_lock){....}-{1:2}, at: __check_timeout+0x181/0x460 net/bluetooth/hci_core.c:3600 stack backtrace: CPU: 0 PID: 3562 Comm: kworker/u5:8 Tainted: G W 6.1.100-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: hci3 hci_tx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_lock_invalid_wait_context kernel/locking/lockdep.c:4701 [inline] check_wait_context kernel/locking/lockdep.c:4762 [inline] __lock_acquire+0x14b1/0x1f80 kernel/locking/lockdep.c:4999 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 hci_cmd_sync_submit+0x3b/0x2e0 net/bluetooth/hci_sync.c:702 hci_disconnect+0xe6/0x2c0 net/bluetooth/hci_conn.c:255 hci_link_tx_to net/bluetooth/hci_core.c:3454 [inline] __check_timeout+0x333/0x460 net/bluetooth/hci_core.c:3600 hci_sched_le net/bluetooth/hci_core.c:3783 [inline] hci_tx_work+0x138b/0x1ec0 net/bluetooth/hci_core.c:3861 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Bluetooth: hci3: command tx timeout Bluetooth: hci3: command 0x0406 tx timeout