====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc3-syzkaller-00288-gb208b9fbbcba #0 Not tainted ------------------------------------------------------ syz-executor.5/3623 is trying to acquire lock: ffff88807d1b4a00 ((work_completion)(&(&hdev->discov_off)->work)){+.+.}-{0:0}, at: __flush_work+0xcf/0x1a0 kernel/workqueue.c:3069 but task is already holding lock: ffff88807d1b4078 (&hdev->lock){+.+.}-{3:3}, at: hci_unregister_dev+0x286/0x460 net/bluetooth/hci_core.c:2707 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #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 discov_off+0x7e/0x1e0 net/bluetooth/mgmt.c:1037 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:306 -> #0 ((work_completion)(&(&hdev->discov_off)->work)){+.+.}-{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 __flush_work+0xeb/0x1a0 kernel/workqueue.c:3069 __cancel_work_timer+0x517/0x6a0 kernel/workqueue.c:3160 mgmt_index_removed+0x2ee/0x430 net/bluetooth/mgmt.c:9433 hci_unregister_dev+0x28e/0x460 net/bluetooth/hci_core.c:2708 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+0x664/0x2070 kernel/exit.c:820 do_group_exit+0x1fd/0x2b0 kernel/exit.c:950 get_signal+0x1743/0x1810 kernel/signal.c:2858 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&hdev->lock); lock((work_completion)(&(&hdev->discov_off)->work)); lock(&hdev->lock); lock((work_completion)(&(&hdev->discov_off)->work)); *** DEADLOCK *** 1 lock held by syz-executor.5/3623: #0: ffff88807d1b4078 (&hdev->lock){+.+.}-{3:3}, at: hci_unregister_dev+0x286/0x460 net/bluetooth/hci_core.c:2707 stack backtrace: CPU: 0 PID: 3623 Comm: syz-executor.5 Not tainted 6.1.0-rc3-syzkaller-00288-gb208b9fbbcba #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/0x2cb 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 __flush_work+0xeb/0x1a0 kernel/workqueue.c:3069 __cancel_work_timer+0x517/0x6a0 kernel/workqueue.c:3160 mgmt_index_removed+0x2ee/0x430 net/bluetooth/mgmt.c:9433 hci_unregister_dev+0x28e/0x460 net/bluetooth/hci_core.c:2708 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+0x664/0x2070 kernel/exit.c:820 do_group_exit+0x1fd/0x2b0 kernel/exit.c:950 get_signal+0x1743/0x1810 kernel/signal.c:2858 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f2588c3d654 Code: Unable to access opcode bytes at 0x7f2588c3d62a. RSP: 002b:00007ffe6f362640 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: 0000000000000005 RBX: 0000000000016a93 RCX: 00007f2588c3d654 RDX: 0000000000000000 RSI: 00007ffe6f362780 RDI: 00000000ffffff9c RBP: 00007ffe6f362780 R08: 0000000000000000 R09: 00007ffe6f362550 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 00007ffe6f363840 R14: 0000555555a04810 R15: 0000000000000005