====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc7-syzkaller-17907-g2d3827b3f393 #0 Not tainted ------------------------------------------------------ syz-executor.0/18303 is trying to acquire lock: ffff0000c92ca130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1725 [inline] ffff0000c92ca130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0xa0/0x23c net/bluetooth/sco.c:197 but task is already holding lock: ffff80000d8b0f98 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] ffff80000d8b0f98 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0x68/0x14c net/bluetooth/hci_conn.c:2437 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+0xd4/0xf64 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 hci_connect_cfm include/net/bluetooth/hci_core.h:1775 [inline] hci_remote_features_evt+0x278/0x514 net/bluetooth/hci_event.c:3768 hci_event_func net/bluetooth/hci_event.c:7485 [inline] hci_event_packet+0x564/0x740 net/bluetooth/hci_event.c:7537 hci_rx_work+0x224/0x538 net/bluetooth/hci_core.c:4043 process_one_work+0x3ac/0x9d0 kernel/workqueue.c:2289 worker_thread+0x340/0x608 kernel/workqueue.c:2436 kthread+0x12c/0x158 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 -> #1 (&hdev->lock){+.+.}-{3:3}: __mutex_lock_common+0xd4/0xf64 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 sco_sock_connect+0x118/0x5f0 net/bluetooth/sco.c:593 __sys_connect_file net/socket.c:1976 [inline] __sys_connect+0x184/0x190 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __arm64_sys_connect+0x28/0x3c net/socket.c:2000 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x64/0x178 arch/arm64/kernel/syscall.c:52 el0_svc_common+0xbc/0x180 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x110 arch/arm64/kernel/syscall.c:193 el0_svc+0x58/0x14c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 -> #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+0x1670/0x2f48 kernel/locking/lockdep.c:5055 lock_acquire+0x164/0x334 kernel/locking/lockdep.c:5668 lock_sock_nested+0x70/0xd8 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0xa0/0x23c net/bluetooth/sco.c:197 sco_disconn_cfm+0x68/0xac net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x8c/0x14c net/bluetooth/hci_conn.c:2437 hci_dev_close_sync+0x50c/0xaac net/bluetooth/hci_sync.c:4850 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_unregister_dev+0x108/0x2ac net/bluetooth/hci_core.c:2702 vhci_release+0x44/0x80 drivers/bluetooth/hci_vhci.c:568 __fput+0x198/0x3e4 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x100/0x148 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x294/0xc24 kernel/exit.c:867 __arm64_sys_exit_group+0x0/0x18 kernel/exit.c:1012 __do_sys_exit_group kernel/exit.c:1023 [inline] __se_sys_exit_group kernel/exit.c:1021 [inline] __wake_up_parent+0x0/0x40 kernel/exit.c:1021 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x64/0x178 arch/arm64/kernel/syscall.c:52 el0_svc_common+0xbc/0x180 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x110 arch/arm64/kernel/syscall.c:193 el0_svc+0x58/0x14c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 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.0/18303: #0: ffff00010c18b028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:552 [inline] #0: ffff00010c18b028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_unregister_dev+0x100/0x2ac net/bluetooth/hci_core.c:2702 #1: ffff00010c18a078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x27c/0xaac net/bluetooth/hci_sync.c:4837 #2: ffff80000d8b0f98 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] #2: ffff80000d8b0f98 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0x68/0x14c net/bluetooth/hci_conn.c:2437 stack backtrace: CPU: 1 PID: 18303 Comm: syz-executor.0 Not tainted 6.2.0-rc7-syzkaller-17907-g2d3827b3f393 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 dump_stack+0x1c/0x28 lib/dump_stack.c:113 print_circular_bug+0x2c4/0x2c8 kernel/locking/lockdep.c:2055 check_noncircular+0x148/0x150 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+0x1670/0x2f48 kernel/locking/lockdep.c:5055 lock_acquire+0x164/0x334 kernel/locking/lockdep.c:5668 lock_sock_nested+0x70/0xd8 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0xa0/0x23c net/bluetooth/sco.c:197 sco_disconn_cfm+0x68/0xac net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x8c/0x14c net/bluetooth/hci_conn.c:2437 hci_dev_close_sync+0x50c/0xaac net/bluetooth/hci_sync.c:4850 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_unregister_dev+0x108/0x2ac net/bluetooth/hci_core.c:2702 vhci_release+0x44/0x80 drivers/bluetooth/hci_vhci.c:568 __fput+0x198/0x3e4 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x100/0x148 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x294/0xc24 kernel/exit.c:867 __arm64_sys_exit_group+0x0/0x18 kernel/exit.c:1012 __do_sys_exit_group kernel/exit.c:1023 [inline] __se_sys_exit_group kernel/exit.c:1021 [inline] __wake_up_parent+0x0/0x40 kernel/exit.c:1021 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x64/0x178 arch/arm64/kernel/syscall.c:52 el0_svc_common+0xbc/0x180 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x110 arch/arm64/kernel/syscall.c:193 el0_svc+0x58/0x14c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591