====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc3-syzkaller-00021-g7dd4b804e080 #0 Not tainted ------------------------------------------------------ syz-executor.1/15759 is trying to acquire lock: ffff8880234e5130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO ){+.+.}-{0:0} , at: lock_sock include/net/sock.h:1725 [inline] , at: sco_conn_del+0xfe/0x2f0 net/bluetooth/sco.c:197 but task is already holding lock: ffffffff8e7be3a8 (hci_cb_list_lock ){+.+.}-{3:3} , at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] , at: hci_conn_hash_flush+0xb8/0x240 net/bluetooth/hci_conn.c:2427 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:5668 __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:1775 [inline] hci_remote_features_evt+0x610/0xa60 net/bluetooth/hci_event.c:3768 hci_event_func net/bluetooth/hci_event.c:7482 [inline] hci_event_packet+0x842/0x10c0 net/bluetooth/hci_event.c:7534 hci_rx_work+0x2fc/0x4a0 net/bluetooth/hci_core.c:4043 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 arch/x86/entry/entry_64.S:308 -> #1 ( &hdev->lock){+.+.}-{3:3} : lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 __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:1976 [inline] __sys_connect+0x29b/0x2d0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:2000 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:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 lock_sock_nested+0x44/0xf0 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0xfe/0x2f0 net/bluetooth/sco.c:197 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:2427 hci_dev_close_sync+0x76d/0xd70 net/bluetooth/hci_sync.c:4850 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_unregister_dev+0x1bc/0x460 net/bluetooth/hci_core.c:2702 vhci_release+0x7f/0xd0 drivers/bluetooth/hci_vhci.c:568 __fput+0x3ba/0x880 fs/file_table.c:320 task_work_run+0x243/0x300 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x644/0x2150 kernel/exit.c:867 do_group_exit+0x1fd/0x2b0 kernel/exit.c:1012 get_signal+0x1755/0x1820 kernel/signal.c:2859 arch_do_signal_or_restart+0x8d/0x5f0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:309 exc_page_fault+0xa2/0x120 arch/x86/mm/fault.c:1578 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 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-executor.1/15759: #0: ffff888030505028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:552 [inline] #0: ffff888030505028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_unregister_dev+0x1b4/0x460 net/bluetooth/hci_core.c:2702 #1: ffff888030504078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x456/0xd70 net/bluetooth/hci_sync.c:4837 #2: ffffffff8e7be3a8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] #2: ffffffff8e7be3a8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xb8/0x240 net/bluetooth/hci_conn.c:2427 stack backtrace: CPU: 1 PID: 15759 Comm: syz-executor.1 Not tainted 6.2.0-rc3-syzkaller-00021-g7dd4b804e080 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 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+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 lock_sock_nested+0x44/0xf0 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0xfe/0x2f0 net/bluetooth/sco.c:197 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:2427 hci_dev_close_sync+0x76d/0xd70 net/bluetooth/hci_sync.c:4850 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_unregister_dev+0x1bc/0x460 net/bluetooth/hci_core.c:2702 vhci_release+0x7f/0xd0 drivers/bluetooth/hci_vhci.c:568 __fput+0x3ba/0x880 fs/file_table.c:320 task_work_run+0x243/0x300 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x644/0x2150 kernel/exit.c:867 do_group_exit+0x1fd/0x2b0 kernel/exit.c:1012 get_signal+0x1755/0x1820 kernel/signal.c:2859 arch_do_signal_or_restart+0x8d/0x5f0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:309 exc_page_fault+0xa2/0x120 arch/x86/mm/fault.c:1578 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fcaa8c89e1e Code: Unable to access opcode bytes at 0x7fcaa8c89df4. RSP: 002b:00007ffe8f112520 EFLAGS: 00010202 RAX: 00007fcaa98d5720 RBX: 0000000000000000 RCX: 00007fcaa8c89dfb RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000555555775400 R10: 00005555557756d0 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000001 R15: 00007ffe8f112600