====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc6-syzkaller-00281-g1707c39ae309 #0 Not tainted ------------------------------------------------------ syz-executor749/4783 is trying to acquire lock: ffff88807a09e130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1712 [inline] ffff88807a09e130 (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: ffffffff8d9c9e68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1776 [inline] ffffffff8d9c9e68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xd5/0x260 net/bluetooth/hci_conn.c:2366 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+0x26/0x140 include/net/bluetooth/hci_core.h:1761 hci_remote_features_evt+0x494/0x900 net/bluetooth/hci_event.c:3757 hci_event_func net/bluetooth/hci_event.c:7443 [inline] hci_event_packet+0x952/0xfd0 net/bluetooth/hci_event.c:7495 hci_rx_work+0xae7/0x1230 net/bluetooth/hci_core.c:4007 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 -> #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+0x1e6/0xa70 net/bluetooth/sco.c:593 __sys_connect_file+0x14f/0x190 net/socket.c:1976 __sys_connect+0x161/0x190 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x6f/0xb0 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/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:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 lock_sock_nested+0x36/0xf0 net/core/sock.c:3393 lock_sock include/net/sock.h:1712 [inline] sco_conn_del+0x12c/0x2b0 net/bluetooth/sco.c:197 sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1779 [inline] hci_conn_hash_flush+0x122/0x260 net/bluetooth/hci_conn.c:2366 hci_dev_close_sync+0x55d/0x1130 net/bluetooth/hci_sync.c:4476 hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554 hci_unregister_dev+0x17f/0x4e0 net/bluetooth/hci_core.c:2682 vhci_release+0x7c/0xf0 drivers/bluetooth/hci_vhci.c:568 __fput+0x277/0x9d0 fs/file_table.c:320 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad5/0x29b0 kernel/exit.c:795 do_group_exit+0xd2/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+0x3a/0x50 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 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-executor749/4783: #0: ffff8880781a0fd0 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x25/0x70 net/bluetooth/hci_core.c:552 #1: ffff8880781a0078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x268/0x1130 net/bluetooth/hci_sync.c:4463 #2: ffffffff8d9c9e68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1776 [inline] #2: ffffffff8d9c9e68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xd5/0x260 net/bluetooth/hci_conn.c:2366 stack backtrace: CPU: 0 PID: 4783 Comm: syz-executor749 Not tainted 6.0.0-rc6-syzkaller-00281-g1707c39ae309 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 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 kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 lock_sock_nested+0x36/0xf0 net/core/sock.c:3393 lock_sock include/net/sock.h:1712 [inline] sco_conn_del+0x12c/0x2b0 net/bluetooth/sco.c:197 sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1779 [inline] hci_conn_hash_flush+0x122/0x260 net/bluetooth/hci_conn.c:2366 hci_dev_close_sync+0x55d/0x1130 net/bluetooth/hci_sync.c:4476 hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554 hci_unregister_dev+0x17f/0x4e0 net/bluetooth/hci_core.c:2682 vhci_release+0x7c/0xf0 drivers/bluetooth/hci_vhci.c:568 __fput+0x277/0x9d0 fs/file_table.c:320 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad5/0x29b0 kernel/exit.c:795 do_group_exit+0xd2/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+0x3a/0x50 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fba09f2e1a9 Code: Unable to access opcode bytes at RIP 0x7fba09f2e17f. RSP: 002b:00007ffc6e03c208 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007fba09fb9470 RCX: 00007fba09f2e1a9 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001 RBP: 0000000000000001 R08: ffffffffffffffbc R09: 00007ffc6e03c290 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fba09fb9470 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001