program: r0 = syz_init_net_socket$bt_l2cap(0x1f, 0x3, 0x0) r1 = syz_open_dev$vbi(&(0x7f0000000040), 0x0, 0x2) ioctl$VIDIOC_S_INPUT(r1, 0xc0045627, &(0x7f00000001c0)=0x2) r2 = syz_open_dev$vim2m(&(0x7f0000000000), 0x7, 0x2) ioctl$vim2m_VIDIOC_S_FMT(r2, 0xc0d05605, &(0x7f00000002c0)={0x1, @pix={0x7, 0x8, 0x39555659, 0x9, 0x27ddd2c7, 0xbd, 0x0, 0x6, 0x0, 0x1, 0x2, 0x5}}) connect$bt_l2cap(r0, &(0x7f0000000080)={0x1f, 0x0, @fixed={'\xaa\xaa\xaa\xaa\xaa', 0x10}, 0x803}, 0xe) syz_emit_vhci(&(0x7f0000000340)=ANY=[@ANYBLOB="02c82028002400010007d3040007c4faff020c04000300d3"], 0x2d) r3 = syz_init_net_socket$llc(0x1a, 0x801, 0x0) bind$llc(r3, &(0x7f0000000000), 0x10) syz_emit_ethernet(0x26, &(0x7f0000000480)={@local, @remote, @void, {@generic={0x18, "c0fab40704046a807c23105e5e8d70915a5e09003c2fe000"}}}, 0x0) r4 = syz_init_net_socket$bt_hci(0x1f, 0x3, 0x1) ioctl$HCIINQUIRY(r4, 0x400448ca, 0x0) [ 86.060688][ T5336] [ 86.061799][ T5336] ====================================================== [ 86.064639][ T5336] WARNING: possible circular locking dependency detected [ 86.067691][ T5336] syzkaller #0 Not tainted [ 86.069613][ T5336] ------------------------------------------------------ [ 86.072661][ T5336] syz.0.0/5336 is trying to acquire lock: [ 86.075236][ T5336] ffff888040d37840 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0xd2/0xbc0 [ 86.080646][ T5336] [ 86.080646][ T5336] but task is already holding lock: [ 86.084040][ T5336] ffff888040d37b38 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5b0 [ 86.088150][ T5336] [ 86.088150][ T5336] which lock already depends on the new lock. [ 86.088150][ T5336] [ 86.092554][ T5336] [ 86.092554][ T5336] the existing dependency chain (in reverse order) is: [ 86.096567][ T5336] [ 86.096567][ T5336] -> #1 (&conn->lock#2){+.+.}-{4:4}: [ 86.099959][ T5336] __mutex_lock+0x187/0x1350 [ 86.102272][ T5336] l2cap_info_timeout+0x60/0xa0 [ 86.104515][ T5336] process_scheduled_works+0xad1/0x1770 [ 86.106795][ T5336] worker_thread+0x8a0/0xda0 [ 86.108911][ T5336] kthread+0x711/0x8a0 [ 86.110740][ T5336] ret_from_fork+0x599/0xb30 [ 86.112880][ T5336] ret_from_fork_asm+0x1a/0x30 [ 86.115072][ T5336] [ 86.115072][ T5336] -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: [ 86.119438][ T5336] __lock_acquire+0x15a6/0x2cf0 [ 86.121866][ T5336] lock_acquire+0x117/0x340 [ 86.124140][ T5336] __flush_work+0x6b8/0xbc0 [ 86.126471][ T5336] __cancel_work_sync+0xbe/0x110 [ 86.129064][ T5336] l2cap_conn_del+0x402/0x5b0 [ 86.131507][ T5336] hci_conn_hash_flush+0x10d/0x260 [ 86.134125][ T5336] hci_dev_close_sync+0x821/0x1100 [ 86.136622][ T5336] hci_dev_close+0x108/0x270 [ 86.138665][ T5336] sock_do_ioctl+0xdc/0x300 [ 86.140960][ T5336] sock_ioctl+0x576/0x790 [ 86.143249][ T5336] __se_sys_ioctl+0xfc/0x170 [ 86.145535][ T5336] do_syscall_64+0xfa/0xf80 [ 86.147567][ T5336] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.150518][ T5336] [ 86.150518][ T5336] other info that might help us debug this: [ 86.150518][ T5336] [ 86.155220][ T5336] Possible unsafe locking scenario: [ 86.155220][ T5336] [ 86.158625][ T5336] CPU0 CPU1 [ 86.161059][ T5336] ---- ---- [ 86.163441][ T5336] lock(&conn->lock#2); [ 86.165331][ T5336] lock((work_completion)(&(&conn->info_timer)->work)); [ 86.169328][ T5336] lock(&conn->lock#2); [ 86.172360][ T5336] lock((work_completion)(&(&conn->info_timer)->work)); [ 86.175504][ T5336] [ 86.175504][ T5336] *** DEADLOCK *** [ 86.175504][ T5336] [ 86.179220][ T5336] 5 locks held by syz.0.0/5336: [ 86.181489][ T5336] #0: ffff888011768ec0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_close+0x100/0x270 [ 86.185823][ T5336] #1: ffff8880117680c0 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x640/0x1100 [ 86.190172][ T5336] #2: ffffffff8f6858c8 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x260 [ 86.194692][ T5336] #3: ffff888040d37b38 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5b0 [ 86.198790][ T5336] #4: ffffffff8e141a20 (rcu_read_lock){....}-{1:3}, at: __flush_work+0xd2/0xbc0 [ 86.202942][ T5336] [ 86.202942][ T5336] stack backtrace: [ 86.205575][ T5336] CPU: 0 UID: 0 PID: 5336 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 86.205592][ T5336] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 86.205600][ T5336] Call Trace: [ 86.205610][ T5336] [ 86.205616][ T5336] dump_stack_lvl+0x189/0x250 [ 86.205634][ T5336] ? __pfx_dump_stack_lvl+0x10/0x10 [ 86.205649][ T5336] ? __pfx__printk+0x10/0x10 [ 86.205667][ T5336] ? print_lock_name+0xde/0x100 [ 86.205685][ T5336] print_circular_bug+0x2e2/0x300 [ 86.205700][ T5336] check_noncircular+0x12e/0x150 [ 86.205715][ T5336] __lock_acquire+0x15a6/0x2cf0 [ 86.205726][ T5336] ? do_raw_spin_unlock+0x4d/0x240 [ 86.205741][ T5336] ? _raw_spin_unlock_irqrestore+0xad/0x110 [ 86.205758][ T5336] ? __pfx__raw_spin_unlock_irqrestore+0x10/0x10 [ 86.205784][ T5336] ? __flush_work+0xd2/0xbc0 [ 86.205798][ T5336] lock_acquire+0x117/0x340 [ 86.205809][ T5336] ? __flush_work+0xd2/0xbc0 [ 86.205823][ T5336] ? _raw_spin_unlock_irq+0x23/0x50 [ 86.205839][ T5336] ? __flush_work+0xd2/0xbc0 [ 86.205851][ T5336] __flush_work+0x6b8/0xbc0 [ 86.205863][ T5336] ? __flush_work+0xd2/0xbc0 [ 86.205875][ T5336] ? __flush_work+0xd2/0xbc0 [ 86.205887][ T5336] ? __pfx___flush_work+0x10/0x10 [ 86.205899][ T5336] ? __pfx_wq_barrier_func+0x10/0x10 [ 86.205912][ T5336] ? __pfx___cancel_work+0x10/0x10 [ 86.205926][ T5336] ? l2cap_conn_del+0x379/0x5b0 [ 86.205944][ T5336] ? __cancel_work_sync+0x5c/0x110 [ 86.205957][ T5336] __cancel_work_sync+0xbe/0x110 [ 86.205970][ T5336] l2cap_conn_del+0x402/0x5b0 [ 86.205986][ T5336] ? __pfx_l2cap_disconn_cfm+0x10/0x10 [ 86.206002][ T5336] hci_conn_hash_flush+0x10d/0x260 [ 86.206019][ T5336] hci_dev_close_sync+0x821/0x1100 [ 86.206035][ T5336] ? __pfx_hci_dev_close_sync+0x10/0x10 [ 86.206049][ T5336] ? __cancel_work_sync+0x5c/0x110 [ 86.206062][ T5336] hci_dev_close+0x108/0x270 [ 86.206077][ T5336] sock_do_ioctl+0xdc/0x300 [ 86.206091][ T5336] ? __pfx_sock_do_ioctl+0x10/0x10 [ 86.206106][ T5336] ? do_futex+0x395/0x420 [ 86.206122][ T5336] sock_ioctl+0x576/0x790 [ 86.206135][ T5336] ? __pfx_sock_ioctl+0x10/0x10 [ 86.206147][ T5336] ? __fget_files+0x3a0/0x420 [ 86.206160][ T5336] ? __fget_files+0x2a/0x420 [ 86.206172][ T5336] ? bpf_lsm_file_ioctl+0x9/0x20 [ 86.206182][ T5336] ? __pfx_sock_ioctl+0x10/0x10 [ 86.206194][ T5336] __se_sys_ioctl+0xfc/0x170 [ 86.206210][ T5336] do_syscall_64+0xfa/0xf80 [ 86.206222][ T5336] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.206232][ T5336] ? clear_bhb_loop+0x60/0xb0 [ 86.206244][ T5336] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.206256][ T5336] RIP: 0033:0x7fb2d558f7c9 [ 86.206267][ T5336] Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 [ 86.206276][ T5336] RSP: 002b:00007fb2d6497038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 86.206289][ T5336] RAX: ffffffffffffffda RBX: 00007fb2d57e5fa0 RCX: 00007fb2d558f7c9 [ 86.206299][ T5336] RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000008 [ 86.206307][ T5336] RBP: 00007fb2d5613f91 R08: 0000000000000000 R09: 0000000000000000 [ 86.206314][ T5336] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 86.206322][ T5336] R13: 00007fb2d57e6038 R14: 00007fb2d57e5fa0 R15: 00007ffeb69418a8 [ 86.206333][ T5336] [ 86.369862][ T4677] Bluetooth: hci0: command tx timeout [ 88.379083][ T4677] Bluetooth: hci0: command tx timeout [ 90.460289][ T4677] Bluetooth: hci0: command tx timeout [ 91.665646][ T786] cfg80211: failed to load regulatory.db