====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc2-syzkaller-00282-g0a71553536d2 #0 Not tainted ------------------------------------------------------ kworker/u5:1/4379 is trying to acquire lock: ffff88807bcd8130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1725 [inline] ffff88807bcd8130 (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: ffffffff8e2dcd68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1775 [inline] ffffffff8e2dcd68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_sco_setup+0x2fa/0x4a0 net/bluetooth/hci_conn.c:633 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/0x1360 kernel/locking/mutex.c:747 hci_connect_cfm include/net/bluetooth/hci_core.h:1775 [inline] hci_remote_features_evt+0x49e/0xa20 net/bluetooth/hci_event.c:3768 hci_event_func net/bluetooth/hci_event.c:7482 [inline] hci_event_packet+0x956/0xfd0 net/bluetooth/hci_event.c:7534 hci_rx_work+0xaeb/0x1230 net/bluetooth/hci_core.c:4043 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 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/0x1360 kernel/locking/mutex.c:747 sco_sock_connect+0x1ea/0xa60 net/bluetooth/sco.c:593 __sys_connect_file+0x153/0x1a0 net/socket.c:1976 __sys_connect+0x165/0x1a0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 lock_sock_nested+0x3a/0xf0 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0x12c/0x2b0 net/bluetooth/sco.c:197 sco_connect_cfm+0x1f4/0x900 net/bluetooth/sco.c:1369 hci_connect_cfm include/net/bluetooth/hci_core.h:1778 [inline] hci_sco_setup+0x365/0x4a0 net/bluetooth/hci_conn.c:633 hci_conn_complete_evt+0xdcd/0xf70 net/bluetooth/hci_event.c:3244 hci_event_func net/bluetooth/hci_event.c:7482 [inline] hci_event_packet+0x956/0xfd0 net/bluetooth/hci_event.c:7534 hci_rx_work+0xaeb/0x1230 net/bluetooth/hci_core.c:4043 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 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 *** 4 locks held by kworker/u5:1/4379: #0: ffff8880651c7938 ((wq_completion)hci0#2){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff8880651c7938 ((wq_completion)hci0#2){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff8880651c7938 ((wq_completion)hci0#2){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff8880651c7938 ((wq_completion)hci0#2){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline] #0: ffff8880651c7938 ((wq_completion)hci0#2){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline] #0: ffff8880651c7938 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work+0x86d/0x1710 kernel/workqueue.c:2260 #1: ffffc9000530fda8 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x8a1/0x1710 kernel/workqueue.c:2264 #2: ffff888079054078 (&hdev->lock){+.+.}-{3:3}, at: hci_conn_complete_evt+0xba/0xf70 net/bluetooth/hci_event.c:3140 #3: ffffffff8e2dcd68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1775 [inline] #3: ffffffff8e2dcd68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_sco_setup+0x2fa/0x4a0 net/bluetooth/hci_conn.c:633 stack backtrace: CPU: 0 PID: 4379 Comm: kworker/u5:1 Not tainted 6.2.0-rc2-syzkaller-00282-g0a71553536d2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 lock_sock_nested+0x3a/0xf0 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0x12c/0x2b0 net/bluetooth/sco.c:197 sco_connect_cfm+0x1f4/0x900 net/bluetooth/sco.c:1369 hci_connect_cfm include/net/bluetooth/hci_core.h:1778 [inline] hci_sco_setup+0x365/0x4a0 net/bluetooth/hci_conn.c:633 hci_conn_complete_evt+0xdcd/0xf70 net/bluetooth/hci_event.c:3244 hci_event_func net/bluetooth/hci_event.c:7482 [inline] hci_event_packet+0x956/0xfd0 net/bluetooth/hci_event.c:7534 hci_rx_work+0xaeb/0x1230 net/bluetooth/hci_core.c:4043 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308