====================================================== WARNING: possible circular locking dependency detected 6.5.0-rc6-syzkaller-00036-g4853c74bd7ab #0 Not tainted ------------------------------------------------------ kworker/u5:2/28985 is trying to acquire lock: ffff8880203cc078 (&hdev->lock){+.+.}-{3:3}, at: discov_off+0x8c/0x1a0 net/bluetooth/mgmt.c:1049 but task is already holding lock: ffffc9000360fd80 ((work_completion)(&(&hdev->discov_off)->work)){+.+.}-{0:0}, at: process_one_work+0x99e/0x16f0 kernel/workqueue.c:2574 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 ((work_completion)(&(&hdev->discov_off)->work)){+.+.}-{0:0}: __flush_work+0x131/0xc10 kernel/workqueue.c:3385 __cancel_work_timer+0x3ef/0x580 kernel/workqueue.c:3476 mgmt_index_removed+0x1ed/0x350 net/bluetooth/mgmt.c:9443 hci_unregister_dev+0x445/0x580 net/bluetooth/hci_core.c:2737 vhci_release+0x7f/0xf0 drivers/bluetooth/hci_vhci.c:669 __fput+0x3f7/0xac0 fs/file_table.c:384 task_work_run+0x14d/0x240 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa99/0x2a20 kernel/exit.c:874 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23ea/0x2770 kernel/signal.c:2881 arch_do_signal_or_restart+0x89/0x5f0 arch/x86/kernel/signal.c:308 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&hdev->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747 discov_off+0x8c/0x1a0 net/bluetooth/mgmt.c:1049 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&(&hdev->discov_off)->work)); lock(&hdev->lock); lock((work_completion)(&(&hdev->discov_off)->work)); lock(&hdev->lock); *** DEADLOCK *** 2 locks held by kworker/u5:2/28985: #0: ffff888040ec2138 ((wq_completion)hci0){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:20 [inline] #0: ffff888040ec2138 ((wq_completion)hci0){+.+.}-{0:0}, at: raw_atomic64_set include/linux/atomic/atomic-arch-fallback.h:2608 [inline] #0: ffff888040ec2138 ((wq_completion)hci0){+.+.}-{0:0}, at: raw_atomic_long_set include/linux/atomic/atomic-long.h:79 [inline] #0: ffff888040ec2138 ((wq_completion)hci0){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:3196 [inline] #0: ffff888040ec2138 ((wq_completion)hci0){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:678 [inline] #0: ffff888040ec2138 ((wq_completion)hci0){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:705 [inline] #0: ffff888040ec2138 ((wq_completion)hci0){+.+.}-{0:0}, at: process_one_work+0x96a/0x16f0 kernel/workqueue.c:2570 #1: ffffc9000360fd80 ((work_completion)(&(&hdev->discov_off)->work)){+.+.}-{0:0}, at: process_one_work+0x99e/0x16f0 kernel/workqueue.c:2574 stack backtrace: CPU: 1 PID: 28985 Comm: kworker/u5:2 Not tainted 6.5.0-rc6-syzkaller-00036-g4853c74bd7ab #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Workqueue: hci0 discov_off Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2195 check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747 discov_off+0x8c/0x1a0 net/bluetooth/mgmt.c:1049 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304