====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc6-syzkaller-00110-gff7afaeca1a1 #0 Not tainted ------------------------------------------------------ syz.3.267/6989 is trying to acquire lock: ffff88807b508078 (&hdev->lock){+.+.}-{3:3}, at: mgmt_remove_adv_monitor_complete+0x9e/0x2e0 net/bluetooth/mgmt.c:5454 but task is already holding lock: ffff88807b508690 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}, at: hci_cmd_sync_clear+0x4a/0x100 net/bluetooth/hci_sync.c:658 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hci_cmd_sync_lookup_entry net/bluetooth/hci_sync.c:838 [inline] hci_cmd_sync_queue_once net/bluetooth/hci_sync.c:782 [inline] hci_update_passive_scan+0x206/0x380 net/bluetooth/hci_sync.c:3207 le_conn_complete_evt+0x1ca/0x1d80 net/bluetooth/hci_event.c:5773 hci_le_conn_complete_evt+0x23c/0x370 net/bluetooth/hci_event.c:5784 hci_le_meta_evt+0x2e5/0x5d0 net/bluetooth/hci_event.c:7132 hci_event_func net/bluetooth/hci_event.c:7440 [inline] hci_event_packet+0x669/0x1180 net/bluetooth/hci_event.c:7495 hci_rx_work+0x2c6/0x16c0 net/bluetooth/hci_core.c:4031 process_one_work+0x9c8/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 (&hdev->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x250b/0x3ce0 kernel/locking/lockdep.c:5202 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 mgmt_remove_adv_monitor_complete+0x9e/0x2e0 net/bluetooth/mgmt.c:5454 _hci_cmd_sync_cancel_entry.constprop.0+0x6f/0x1d0 net/bluetooth/hci_sync.c:645 hci_cmd_sync_clear+0xac/0x100 net/bluetooth/hci_sync.c:660 hci_unregister_dev+0x1b8/0x620 net/bluetooth/hci_core.c:2694 vhci_release+0x79/0xf0 drivers/bluetooth/hci_vhci.c:664 __fput+0x3f9/0xb60 fs/file_table.c:431 task_work_run+0x151/0x250 kernel/task_work.c:239 exit_task_work include/linux/task_work.h:43 [inline] do_exit+0xadd/0x2d70 kernel/exit.c:939 do_group_exit+0xd3/0x2a0 kernel/exit.c:1088 get_signal+0x25fb/0x2770 kernel/signal.c:2917 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337 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+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 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->cmd_sync_work_lock); lock(&hdev->lock); lock(&hdev->cmd_sync_work_lock); lock(&hdev->lock); *** DEADLOCK *** 1 lock held by syz.3.267/6989: #0: ffff88807b508690 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}, at: hci_cmd_sync_clear+0x4a/0x100 net/bluetooth/hci_sync.c:658 stack backtrace: CPU: 1 UID: 0 PID: 6989 Comm: syz.3.267 Not tainted 6.12.0-rc6-syzkaller-00110-gff7afaeca1a1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x41c/0x610 kernel/locking/lockdep.c:2074 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x250b/0x3ce0 kernel/locking/lockdep.c:5202 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 mgmt_remove_adv_monitor_complete+0x9e/0x2e0 net/bluetooth/mgmt.c:5454 _hci_cmd_sync_cancel_entry.constprop.0+0x6f/0x1d0 net/bluetooth/hci_sync.c:645 hci_cmd_sync_clear+0xac/0x100 net/bluetooth/hci_sync.c:660 hci_unregister_dev+0x1b8/0x620 net/bluetooth/hci_core.c:2694 vhci_release+0x79/0xf0 drivers/bluetooth/hci_vhci.c:664 __fput+0x3f9/0xb60 fs/file_table.c:431 task_work_run+0x151/0x250 kernel/task_work.c:239 exit_task_work include/linux/task_work.h:43 [inline] do_exit+0xadd/0x2d70 kernel/exit.c:939 do_group_exit+0xd3/0x2a0 kernel/exit.c:1088 get_signal+0x25fb/0x2770 kernel/signal.c:2917 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337 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+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f901677e719 Code: Unable to access opcode bytes at 0x7f901677e6ef. RSP: 002b:00007f9017526038 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: 0000000000018ff8 RBX: 00007f9016935f80 RCX: 00007f901677e719 RDX: 0000000000018ff8 RSI: 0000000020019680 RDI: 0000000000000004 RBP: 00007f90167f139e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9016935f80 R15: 00007ffdef17a4c8