====================================================== WARNING: possible circular locking dependency detected 5.19.0-syzkaller-02972-g200e340f2196 #0 Not tainted ------------------------------------------------------ syz-executor227/3611 is trying to acquire lock: ffff888017753130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1677 [inline] ffff888017753130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0xfe/0x2f0 net/bluetooth/sco.c:197 but task is already holding lock: ffffffff8dd19aa8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1580 [inline] ffffffff8dd19aa8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xb8/0x240 net/bluetooth/hci_conn.c:1475 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+0x1a7/0x400 kernel/locking/lockdep.c:5666 __mutex_lock_common+0x1de/0x26c0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 hci_connect_cfm include/net/bluetooth/hci_core.h:1565 [inline] hci_remote_features_evt+0x4dd/0xac0 net/bluetooth/hci_event.c:3754 hci_event_func net/bluetooth/hci_event.c:6921 [inline] hci_event_packet+0x7d7/0x1020 net/bluetooth/hci_event.c:6970 hci_rx_work+0x249/0x430 net/bluetooth/hci_core.c:3820 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 -> #1 (&hdev->lock){+.+.}-{3:3}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 __mutex_lock_common+0x1de/0x26c0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 sco_sock_connect+0x168/0x350 net/bluetooth/sco.c:593 __sys_connect_file net/socket.c:1979 [inline] __sys_connect+0x29b/0x2d0 net/socket.c:1996 __do_sys_connect net/socket.c:2006 [inline] __se_sys_connect net/socket.c:2003 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:2003 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 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:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x185c/0x65c0 kernel/locking/lockdep.c:3829 __lock_acquire+0x129a/0x1f80 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 lock_sock_nested+0x44/0xf0 net/core/sock.c:3389 lock_sock include/net/sock.h:1677 [inline] sco_conn_del+0xfe/0x2f0 net/bluetooth/sco.c:197 hci_disconn_cfm include/net/bluetooth/hci_core.h:1583 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:1475 hci_dev_close_sync+0x6e9/0xcb0 net/bluetooth/hci_sync.c:4151 hci_dev_do_close net/bluetooth/hci_core.c:553 [inline] hci_unregister_dev+0x1be/0x470 net/bluetooth/hci_core.c:2688 vhci_release+0x7f/0xd0 drivers/bluetooth/hci_vhci.c:568 __fput+0x3b9/0x820 fs/file_table.c:319 task_work_run+0x146/0x1c0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x55e/0x20a0 kernel/exit.c:795 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd 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 *** 3 locks held by syz-executor227/3611: #0: ffff88814630d048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:551 [inline] #0: ffff88814630d048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_unregister_dev+0x1b6/0x470 net/bluetooth/hci_core.c:2688 #1: ffff88814630c078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x3c6/0xcb0 net/bluetooth/hci_sync.c:4138 #2: ffffffff8dd19aa8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1580 [inline] #2: ffffffff8dd19aa8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xb8/0x240 net/bluetooth/hci_conn.c:1475 stack backtrace: CPU: 0 PID: 3611 Comm: syz-executor227 Not tainted 5.19.0-syzkaller-02972-g200e340f2196 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2f7/0x3b0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x185c/0x65c0 kernel/locking/lockdep.c:3829 __lock_acquire+0x129a/0x1f80 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 lock_sock_nested+0x44/0xf0 net/core/sock.c:3389 lock_sock include/net/sock.h:1677 [inline] sco_conn_del+0xfe/0x2f0 net/bluetooth/sco.c:197 hci_disconn_cfm include/net/bluetooth/hci_core.h:1583 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:1475 hci_dev_close_sync+0x6e9/0xcb0 net/bluetooth/hci_sync.c:4151 hci_dev_do_close net/bluetooth/hci_core.c:553 [inline] hci_unregister_dev+0x1be/0x470 net/bluetooth/hci_core.c:2688 vhci_release+0x7f/0xd0 drivers/bluetooth/hci_vhci.c:568 __fput+0x3b9/0x820 fs/file_table.c:319 task_work_run+0x146/0x1c0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x55e/0x20a0 kernel/exit.c:795 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f9a8c11d7e9 Code: Unable to access opcode bytes at RIP 0x7f9a8c11d7bf. RSP: 002b:00007ffee988ea38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007f9a8c1a8450 RCX: 00007f9a8c11d7e9 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001 RBP: 0000000000000001 R08: ffffffffffffffb8 R09: 00007f9a8c1a6880 R10: 0000000000000231 R11: 0000000000000246 R12: 00007f9a8c1a8450 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001