====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc5-next-20240426-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.2/6714 is trying to acquire lock: ffff88805d03c8d0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] ffff88805d03c8d0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline] ffff88805d03c8d0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}, at: start_flush_work kernel/workqueue.c:4113 [inline] ffff88805d03c8d0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}, at: __flush_work+0xe6/0xd00 kernel/workqueue.c:4172 but task is already holding lock: ffff88805d03d060 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:559 [inline] ffff88805d03d060 (&hdev->req_lock){+.+.}-{3:3}, at: hci_unregister_dev+0x1d3/0x4e0 net/bluetooth/hci_core.c:2778 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&hdev->req_lock){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hci_cmd_sync_work+0x1ec/0x400 net/bluetooth/hci_sync.c:309 process_one_work kernel/workqueue.c:3222 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3303 worker_thread+0x86d/0xd70 kernel/workqueue.c:3384 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 touch_work_lockdep_map kernel/workqueue.c:3885 [inline] start_flush_work kernel/workqueue.c:4139 [inline] __flush_work+0x73c/0xd00 kernel/workqueue.c:4172 __cancel_work_sync+0xbc/0x110 kernel/workqueue.c:4322 hci_cmd_sync_clear+0x30/0x220 net/bluetooth/hci_sync.c:588 hci_dev_close_sync+0xbae/0x1060 net/bluetooth/hci_sync.c:5188 hci_dev_do_close net/bluetooth/hci_core.c:561 [inline] hci_unregister_dev+0x1db/0x4e0 net/bluetooth/hci_core.c:2778 vhci_release+0x83/0xd0 drivers/bluetooth/hci_vhci.c:674 __fput+0x406/0x8b0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa27/0x27e0 kernel/exit.c:874 do_group_exit+0x207/0x2c0 kernel/exit.c:1023 get_signal+0x16a1/0x1740 kernel/signal.c:2909 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 do_syscall_64+0x102/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&hdev->req_lock); lock((work_completion)(&hdev->cmd_sync_work)); lock(&hdev->req_lock); lock((work_completion)(&hdev->cmd_sync_work)); *** DEADLOCK *** 2 locks held by syz-executor.2/6714: #0: ffff88805d03d060 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:559 [inline] #0: ffff88805d03d060 (&hdev->req_lock){+.+.}-{3:3}, at: hci_unregister_dev+0x1d3/0x4e0 net/bluetooth/hci_core.c:2778 #1: ffffffff8e333ba0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #1: ffffffff8e333ba0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline] #1: ffffffff8e333ba0 (rcu_read_lock){....}-{1:2}, at: start_flush_work kernel/workqueue.c:4113 [inline] #1: ffffffff8e333ba0 (rcu_read_lock){....}-{1:2}, at: __flush_work+0xe6/0xd00 kernel/workqueue.c:4172 stack backtrace: CPU: 0 PID: 6714 Comm: syz-executor.2 Not tainted 6.9.0-rc5-next-20240426-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 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+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 touch_work_lockdep_map kernel/workqueue.c:3885 [inline] start_flush_work kernel/workqueue.c:4139 [inline] __flush_work+0x73c/0xd00 kernel/workqueue.c:4172 __cancel_work_sync+0xbc/0x110 kernel/workqueue.c:4322 hci_cmd_sync_clear+0x30/0x220 net/bluetooth/hci_sync.c:588 hci_dev_close_sync+0xbae/0x1060 net/bluetooth/hci_sync.c:5188 hci_dev_do_close net/bluetooth/hci_core.c:561 [inline] hci_unregister_dev+0x1db/0x4e0 net/bluetooth/hci_core.c:2778 vhci_release+0x83/0xd0 drivers/bluetooth/hci_vhci.c:674 __fput+0x406/0x8b0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa27/0x27e0 kernel/exit.c:874 do_group_exit+0x207/0x2c0 kernel/exit.c:1023 get_signal+0x16a1/0x1740 kernel/signal.c:2909 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 do_syscall_64+0x102/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f224047d687 Code: Unable to access opcode bytes at 0x7f224047d65d. RSP: 002b:00007fffd4f1de18 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: 0000000000000000 RBX: 0000000000000065 RCX: 00007f224047d687 RDX: 0000000000000200 RSI: 00007fffd4f1ef90 RDI: 00000000ffffff9c RBP: 00007f22404c93b9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007fffd4f1ef90 R13: 00007f22404c93b9 R14: 0000000000028649 R15: 0000000000000006