Bluetooth: hci2: Opcode 0x0c1a failed: -4 Bluetooth: hci2: Opcode 0x0406 failed: -4 ====================================================== WARNING: possible circular locking dependency detected 6.16.0-rc6-syzkaller-00281-gf4a40a4282f4 #0 Not tainted ------------------------------------------------------ syz.3.2750/15541 is trying to acquire lock: ffff88804cf5d040 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: touch_work_lockdep_map kernel/workqueue.c:3924 [inline] ffff88804cf5d040 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: start_flush_work kernel/workqueue.c:4178 [inline] ffff88804cf5d040 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0x4d0/0xcc0 kernel/workqueue.c:4210 but task is already holding lock: ffff88804cf5d338 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x80/0x730 net/bluetooth/l2cap_core.c:1762 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&conn->lock#2){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:602 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:747 l2cap_info_timeout+0x79/0xa0 net/bluetooth/l2cap_core.c:1668 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402 kthread+0x3c2/0x780 kernel/kthread.c:464 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3168 [inline] check_prevs_add kernel/locking/lockdep.c:3287 [inline] validate_chain kernel/locking/lockdep.c:3911 [inline] __lock_acquire+0x126f/0x1c90 kernel/locking/lockdep.c:5240 lock_acquire kernel/locking/lockdep.c:5871 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5828 touch_work_lockdep_map kernel/workqueue.c:3924 [inline] start_flush_work kernel/workqueue.c:4178 [inline] __flush_work+0x4e4/0xcc0 kernel/workqueue.c:4210 __cancel_work_sync+0x10c/0x130 kernel/workqueue.c:4366 l2cap_conn_del+0x5af/0x730 net/bluetooth/l2cap_core.c:1796 l2cap_connect_cfm+0x9e1/0xf80 net/bluetooth/l2cap_core.c:7259 hci_connect_cfm include/net/bluetooth/hci_core.h:2059 [inline] hci_conn_failed+0x1bd/0x330 net/bluetooth/hci_conn.c:1275 hci_abort_conn_sync+0x762/0xb10 net/bluetooth/hci_sync.c:5689 hci_disconnect_all_sync.constprop.0+0x104/0x3c0 net/bluetooth/hci_sync.c:5712 hci_suspend_sync+0x770/0xab0 net/bluetooth/hci_sync.c:6188 hci_suspend_dev+0x308/0x500 net/bluetooth/hci_core.c:2851 hci_suspend_notifier+0x28d/0x2f0 net/bluetooth/hci_core.c:2422 notifier_call_chain+0xbc/0x410 kernel/notifier.c:85 notifier_call_chain_robust kernel/notifier.c:120 [inline] blocking_notifier_call_chain_robust kernel/notifier.c:345 [inline] blocking_notifier_call_chain_robust+0xc8/0x160 kernel/notifier.c:333 pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:102 snapshot_open+0x189/0x2b0 kernel/power/user.c:77 misc_open+0x35a/0x420 drivers/char/misc.c:161 chrdev_open+0x231/0x6a0 fs/char_dev.c:414 do_dentry_open+0x744/0x1c10 fs/open.c:964 vfs_open+0x82/0x3f0 fs/open.c:1094 do_open fs/namei.c:3896 [inline] path_openat+0x1de4/0x2cb0 fs/namei.c:4055 do_filp_open+0x20b/0x470 fs/namei.c:4082 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_compat_sys_openat fs/open.c:1514 [inline] __se_compat_sys_openat fs/open.c:1512 [inline] __ia32_compat_sys_openat+0x16d/0x210 fs/open.c:1512 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&conn->lock#2); lock((work_completion)(&(&conn->info_timer)->work)); lock(&conn->lock#2); lock((work_completion)(&(&conn->info_timer)->work)); *** DEADLOCK *** 8 locks held by syz.3.2750/15541: #0: ffffffff8f3002e8 (misc_mtx){+.+.}-{4:4}, at: misc_open+0x63/0x420 drivers/char/misc.c:125 #1: ffffffff8e488228 (system_transition_mutex){+.+.}-{4:4}, at: lock_system_sleep+0x87/0xa0 kernel/power/main.c:56 #2: ffffffff8e4c8910 ((pm_chain_head).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain_robust kernel/notifier.c:344 [inline] #2: ffffffff8e4c8910 ((pm_chain_head).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain_robust+0xa8/0x160 kernel/notifier.c:333 #3: ffff8880290d4dc0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_suspend_dev+0x300/0x500 net/bluetooth/hci_core.c:2850 #4: ffff8880290d40b8 (&hdev->lock){+.+.}-{4:4}, at: hci_abort_conn_sync+0x13f/0xb10 net/bluetooth/hci_sync.c:5670 #5: ffffffff905d19e8 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:2056 [inline] #5: ffffffff905d19e8 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_failed+0x14f/0x330 net/bluetooth/hci_conn.c:1275 #6: ffff88804cf5d338 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x80/0x730 net/bluetooth/l2cap_core.c:1762 #7: ffffffff8e5c4c80 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline] #7: ffffffff8e5c4c80 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline] #7: ffffffff8e5c4c80 (rcu_read_lock){....}-{1:3}, at: start_flush_work kernel/workqueue.c:4152 [inline] #7: ffffffff8e5c4c80 (rcu_read_lock){....}-{1:3}, at: __flush_work+0xfb/0xcc0 kernel/workqueue.c:4210 stack backtrace: CPU: 2 UID: 0 PID: 15541 Comm: syz.3.2750 Not tainted 6.16.0-rc6-syzkaller-00281-gf4a40a4282f4 #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x275/0x350 kernel/locking/lockdep.c:2046 check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3168 [inline] check_prevs_add kernel/locking/lockdep.c:3287 [inline] validate_chain kernel/locking/lockdep.c:3911 [inline] __lock_acquire+0x126f/0x1c90 kernel/locking/lockdep.c:5240 lock_acquire kernel/locking/lockdep.c:5871 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5828 touch_work_lockdep_map kernel/workqueue.c:3924 [inline] start_flush_work kernel/workqueue.c:4178 [inline] __flush_work+0x4e4/0xcc0 kernel/workqueue.c:4210 __cancel_work_sync+0x10c/0x130 kernel/workqueue.c:4366 l2cap_conn_del+0x5af/0x730 net/bluetooth/l2cap_core.c:1796 l2cap_connect_cfm+0x9e1/0xf80 net/bluetooth/l2cap_core.c:7259 hci_connect_cfm include/net/bluetooth/hci_core.h:2059 [inline] hci_conn_failed+0x1bd/0x330 net/bluetooth/hci_conn.c:1275 hci_abort_conn_sync+0x762/0xb10 net/bluetooth/hci_sync.c:5689 hci_disconnect_all_sync.constprop.0+0x104/0x3c0 net/bluetooth/hci_sync.c:5712 hci_suspend_sync+0x770/0xab0 net/bluetooth/hci_sync.c:6188 hci_suspend_dev+0x308/0x500 net/bluetooth/hci_core.c:2851 hci_suspend_notifier+0x28d/0x2f0 net/bluetooth/hci_core.c:2422 notifier_call_chain+0xbc/0x410 kernel/notifier.c:85 notifier_call_chain_robust kernel/notifier.c:120 [inline] blocking_notifier_call_chain_robust kernel/notifier.c:345 [inline] blocking_notifier_call_chain_robust+0xc8/0x160 kernel/notifier.c:333 pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:102 snapshot_open+0x189/0x2b0 kernel/power/user.c:77 misc_open+0x35a/0x420 drivers/char/misc.c:161 chrdev_open+0x231/0x6a0 fs/char_dev.c:414 do_dentry_open+0x744/0x1c10 fs/open.c:964 vfs_open+0x82/0x3f0 fs/open.c:1094 do_open fs/namei.c:3896 [inline] path_openat+0x1de4/0x2cb0 fs/namei.c:4055 do_filp_open+0x20b/0x470 fs/namei.c:4082 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_compat_sys_openat fs/open.c:1514 [inline] __se_compat_sys_openat fs/open.c:1512 [inline] __ia32_compat_sys_openat+0x16d/0x210 fs/open.c:1512 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf711e579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f510e55c EFLAGS: 00000296 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 0000000080000680 RDX: 0000000000040000 RSI: 0000000000000019 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi