Bluetooth: hci3: Controller not accepting commands anymore: ncmd = 0 Bluetooth: hci3: Injecting HCI hardware error event Bluetooth: hci3: hardware error 0x00 ====================================================== WARNING: possible circular locking dependency detected 6.2.0-syzkaller-13467-g0988a0ea7919 #0 Not tainted ------------------------------------------------------ kworker/u9:2/5190 is trying to acquire lock: ffff888022220130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1697 [inline] ffff888022220130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x12c/0x2b0 net/bluetooth/sco.c:197 but task is already holding lock: ffffffff8e32b428 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] ffffffff8e32b428 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xd9/0x260 net/bluetooth/hci_conn.c:2440 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (hci_cb_list_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 hci_connect_cfm include/net/bluetooth/hci_core.h:1775 [inline] hci_remote_features_evt+0x4d8/0xa50 net/bluetooth/hci_event.c:3768 hci_event_func net/bluetooth/hci_event.c:7485 [inline] hci_event_packet+0x956/0xfd0 net/bluetooth/hci_event.c:7537 hci_rx_work+0xaeb/0x1340 net/bluetooth/hci_core.c:4043 process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 -> #1 (&hdev->lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 sco_sock_connect+0x1ea/0xa60 net/bluetooth/sco.c:593 __sys_connect_file+0x153/0x1a0 net/socket.c:2004 __sys_connect+0x165/0x1a0 net/socket.c:2021 __do_sys_connect net/socket.c:2031 [inline] __se_sys_connect net/socket.c:2028 [inline] __ia32_sys_connect+0x72/0xb0 net/socket.c:2028 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1e3/0x670 kernel/locking/lockdep.c:5634 lock_sock_nested+0x3a/0xf0 net/core/sock.c:3473 lock_sock include/net/sock.h:1697 [inline] sco_conn_del+0x12c/0x2b0 net/bluetooth/sco.c:197 sco_disconn_cfm+0x75/0xb0 net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x126/0x260 net/bluetooth/hci_conn.c:2440 hci_dev_close_sync+0x5fb/0x1200 net/bluetooth/hci_sync.c:4850 hci_dev_do_close+0x31/0x70 net/bluetooth/hci_core.c:554 hci_error_reset+0xa2/0x140 net/bluetooth/hci_core.c:1059 process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 other info that might help us debug this: Chain exists of: sk_lock-AF_BLUETOOTH-BTPROTO_SCO --> &hdev->lock --> hci_cb_list_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(hci_cb_list_lock); lock(&hdev->lock); lock(hci_cb_list_lock); lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO); *** DEADLOCK *** 5 locks held by kworker/u9:2/5190: #0: ffff888043a26938 ((wq_completion)hci3){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888043a26938 ((wq_completion)hci3){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888043a26938 ((wq_completion)hci3){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888043a26938 ((wq_completion)hci3){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:639 [inline] #0: ffff888043a26938 ((wq_completion)hci3){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:666 [inline] #0: ffff888043a26938 ((wq_completion)hci3){+.+.}-{0:0}, at: process_one_work+0x86d/0x1820 kernel/workqueue.c:2361 #1: ffffc90002f07da8 ((work_completion)(&hdev->error_reset)){+.+.}-{0:0}, at: process_one_work+0x8a1/0x1820 kernel/workqueue.c:2365 #2: ffff88801bcb5028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x29/0x70 net/bluetooth/hci_core.c:552 #3: ffff88801bcb4078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x306/0x1200 net/bluetooth/hci_sync.c:4837 #4: ffffffff8e32b428 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] #4: ffffffff8e32b428 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xd9/0x260 net/bluetooth/hci_conn.c:2440 stack backtrace: CPU: 3 PID: 5190 Comm: kworker/u9:2 Not tainted 6.2.0-syzkaller-13467-g0988a0ea7919 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: hci3 hci_error_reset Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1e3/0x670 kernel/locking/lockdep.c:5634 lock_sock_nested+0x3a/0xf0 net/core/sock.c:3473 lock_sock include/net/sock.h:1697 [inline] sco_conn_del+0x12c/0x2b0 net/bluetooth/sco.c:197 sco_disconn_cfm+0x75/0xb0 net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x126/0x260 net/bluetooth/hci_conn.c:2440 hci_dev_close_sync+0x5fb/0x1200 net/bluetooth/hci_sync.c:4850 hci_dev_do_close+0x31/0x70 net/bluetooth/hci_core.c:554 hci_error_reset+0xa2/0x140 net/bluetooth/hci_core.c:1059 process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Bluetooth: hci3: Opcode 0x c03 failed: -110