====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc6-syzkaller-00171-gdcea1bd45e6d #0 Not tainted ------------------------------------------------------ syz-executor.4/18568 is trying to acquire lock: ffff888046db4ae0 ((work_completion)(&(&hdev->discov_off)->work)){+.+.}-{0:0}, at: __flush_work+0xfa/0xa10 kernel/workqueue.c:3400 but task is already holding lock: ffff888046db4078 (&hdev->lock){+.+.}-{3:3}, at: hci_unregister_dev+0x46a/0x600 net/bluetooth/hci_core.c:2744 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&hdev->lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:747 discov_off+0x8c/0x1d0 net/bluetooth/mgmt.c:1055 process_one_work+0x886/0x15d0 kernel/workqueue.c:2627 process_scheduled_works kernel/workqueue.c:2700 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2781 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 -> #0 ((work_completion)(&(&hdev->discov_off)->work)){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __flush_work+0x103/0xa10 kernel/workqueue.c:3400 __cancel_work_timer+0x3ef/0x590 kernel/workqueue.c:3491 mgmt_index_removed+0x1ed/0x350 net/bluetooth/mgmt.c:9447 hci_unregister_dev+0x472/0x600 net/bluetooth/hci_core.c:2745 vhci_release+0x7f/0x100 drivers/bluetooth/hci_vhci.c:674 __fput+0x270/0xb70 fs/file_table.c:394 task_work_run+0x14d/0x240 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa8a/0x2ad0 kernel/exit.c:869 do_group_exit+0xd4/0x2a0 kernel/exit.c:1018 get_signal+0x23b5/0x2790 kernel/signal.c:2904 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x121/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1e/0x60 kernel/entry/common.c:296 do_syscall_64+0x4d/0x110 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x63/0x6b 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.4/18568: #0: ffff888046db4078 (&hdev->lock){+.+.}-{3:3}, at: hci_unregister_dev+0x46a/0x600 net/bluetooth/hci_core.c:2744 stack backtrace: CPU: 0 PID: 18568 Comm: syz-executor.4 Not tainted 6.7.0-rc6-syzkaller-00171-gdcea1bd45e6d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x317/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __flush_work+0x103/0xa10 kernel/workqueue.c:3400 __cancel_work_timer+0x3ef/0x590 kernel/workqueue.c:3491 mgmt_index_removed+0x1ed/0x350 net/bluetooth/mgmt.c:9447 hci_unregister_dev+0x472/0x600 net/bluetooth/hci_core.c:2745 vhci_release+0x7f/0x100 drivers/bluetooth/hci_vhci.c:674 __fput+0x270/0xb70 fs/file_table.c:394 task_work_run+0x14d/0x240 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa8a/0x2ad0 kernel/exit.c:869 do_group_exit+0xd4/0x2a0 kernel/exit.c:1018 get_signal+0x23b5/0x2790 kernel/signal.c:2904 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x121/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1e/0x60 kernel/entry/common.c:296 do_syscall_64+0x4d/0x110 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f8c3807cce9 Code: Unable to access opcode bytes at 0x7f8c3807ccbf. RSP: 002b:00007f8c38e620c8 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: fffffffffffffe00 RBX: 00007f8c3819bf80 RCX: 00007f8c3807cce9 RDX: 000000000000e100 RSI: 00000000200005c0 RDI: 0000000000000007 RBP: 00007f8c380c947a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f8c3819bf80 R15: 00007ffd6bcacbf8 syz_tun (unregistering): left allmulticast mode syz_tun (unregistering): left promiscuous mode bridge0: port 1(syz_tun) entered disabled state