====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc6-syzkaller-g0bcc40255504 #0 Not tainted ------------------------------------------------------ kworker/u5:2/5244 is trying to acquire lock: ffff888029cb0130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1697 [inline] ffff888029cb0130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x104/0x300 net/bluetooth/sco.c:197 but task is already holding lock: ffffffff8e1dfbc8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1776 [inline] ffffffff8e1dfbc8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_sco_setup+0xce/0x4c0 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}: lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 hci_connect_cfm include/net/bluetooth/hci_core.h:1776 [inline] hci_remote_features_evt+0x675/0xaa0 net/bluetooth/hci_event.c:3768 hci_event_func net/bluetooth/hci_event.c:7485 [inline] hci_event_packet+0x970/0x1360 net/bluetooth/hci_event.c:7537 hci_rx_work+0x446/0xa90 net/bluetooth/hci_core.c:4058 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x270/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 -> #1 (&hdev->lock){+.+.}-{3:3}: lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 sco_sock_connect+0x185/0x8f0 net/bluetooth/sco.c:593 __sys_connect_file net/socket.c:2001 [inline] __sys_connect+0x2cd/0x300 net/socket.c:2018 __do_sys_connect net/socket.c:2028 [inline] __se_sys_connect net/socket.c:2025 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2025 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 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:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 lock_sock_nested+0x48/0x100 net/core/sock.c:3474 lock_sock include/net/sock.h:1697 [inline] sco_conn_del+0x104/0x300 net/bluetooth/sco.c:197 sco_connect_cfm+0xe6/0xc60 net/bluetooth/sco.c:1369 hci_connect_cfm include/net/bluetooth/hci_core.h:1779 [inline] hci_sco_setup+0x141/0x4c0 net/bluetooth/hci_conn.c:633 hci_conn_complete_evt+0x234/0xf00 net/bluetooth/hci_event.c:3244 hci_event_func net/bluetooth/hci_event.c:7485 [inline] hci_event_packet+0x970/0x1360 net/bluetooth/hci_event.c:7537 hci_rx_work+0x446/0xa90 net/bluetooth/hci_core.c:4058 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x270/0x300 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:2/5244: #0: ffff88807e0e4938 ((wq_completion)hci2#2){+.+.}-{0:0}, at: process_one_work+0x77e/0x10e0 kernel/workqueue.c:2363 #1: ffffc90004c87d20 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x7c8/0x10e0 kernel/workqueue.c:2365 #2: ffff88807cc80078 (&hdev->lock){+.+.}-{3:3}, at: hci_conn_complete_evt+0xc3/0xf00 net/bluetooth/hci_event.c:3140 #3: ffffffff8e1dfbc8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1776 [inline] #3: ffffffff8e1dfbc8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_sco_setup+0xce/0x4c0 net/bluetooth/hci_conn.c:633 stack backtrace: CPU: 1 PID: 5244 Comm: kworker/u5:2 Not tainted 6.3.0-rc6-syzkaller-g0bcc40255504 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Workqueue: hci2 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2fe/0x3b0 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+0x166b/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 lock_sock_nested+0x48/0x100 net/core/sock.c:3474 lock_sock include/net/sock.h:1697 [inline] sco_conn_del+0x104/0x300 net/bluetooth/sco.c:197 sco_connect_cfm+0xe6/0xc60 net/bluetooth/sco.c:1369 hci_connect_cfm include/net/bluetooth/hci_core.h:1779 [inline] hci_sco_setup+0x141/0x4c0 net/bluetooth/hci_conn.c:633 hci_conn_complete_evt+0x234/0xf00 net/bluetooth/hci_event.c:3244 hci_event_func net/bluetooth/hci_event.c:7485 [inline] hci_event_packet+0x970/0x1360 net/bluetooth/hci_event.c:7537 hci_rx_work+0x446/0xa90 net/bluetooth/hci_core.c:4058 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x270/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308