program: r0 = syz_init_net_socket$bt_l2cap(0x1f, 0x1, 0x3) connect(r0, &(0x7f0000000000)=@rc={0x1f, @fixed={'\xaa\xaa\xaa\xaa\xaa', 0x10}, 0x8}, 0x80) r1 = syz_init_net_socket$bt_hci(0x1f, 0x3, 0x1) r2 = bpf$MAP_CREATE_CONST_STR(0x0, &(0x7f0000000240)={0x2, 0x4, 0x8, 0x1, 0x80, 0xffffffffffffffff, 0x0, '\x00', 0x0, 0x0}, 0x48) r3 = bpf$MAP_CREATE_RINGBUF(0x0, &(0x7f00000007c0)={0x1b, 0x0, 0x0, 0x40000, 0x0, 0x0, 0x0, '\x00', 0x0, 0x0}, 0x48) bpf$PROG_LOAD(0x5, &(0x7f0000000840)={0x8, 0x1c, &(0x7f0000000d80)=@ringbuf={{0x18, 0x8, 0x0, 0x0, 0x18}, {{0x18, 0x1, 0x1, 0x0, r3}, {}, {}, {0x85, 0x0, 0x0, 0x5}, {0x4, 0x1, 0xb, 0x9, 0xa}}, {{0x5, 0x0, 0x3}}, [@snprintf={{0x5, 0x0, 0x7, 0x9, 0x0, 0x2, 0x2}, {0x3, 0x3, 0x3, 0xa, 0x9, 0xfe00}, {0x5, 0x0, 0xb, 0x9}, {0x3, 0x0, 0x6, 0xa, 0x9, 0xfe04, 0xe1}, {0x7, 0x1, 0xb, 0x7, 0x8}, {0x7, 0x0, 0x0, 0x8}, {}, {}, {}, {0x18, 0x9, 0x2, 0x0, r2}, {}, {0x46, 0x8, 0xfff0, 0x76}}], {{0x7, 0x1, 0xb, 0x8}, {0x6, 0x0, 0x5, 0x8}, {0x85, 0x0, 0x0, 0x7}}}, &(0x7f0000000980)='GPL\x00', 0x6, 0x0, 0x0, 0x0, 0xa, '\x00', 0x0, @cgroup_skb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, 0x90) ioctl$HCIINQUIRY(r1, 0x400448ca, 0x0) [ 134.203666][ T5330] [ 134.204698][ T5330] ====================================================== [ 134.207964][ T5330] WARNING: possible circular locking dependency detected [ 134.211908][ T5330] syzkaller #0 Not tainted [ 134.214442][ T5330] ------------------------------------------------------ [ 134.217470][ T5330] syz.0.0/5330 is trying to acquire lock: [ 134.219458][ T5330] ffff888043c03040 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0xd2/0xbc0 [ 134.223945][ T5330] [ 134.223945][ T5330] but task is already holding lock: [ 134.226589][ T5330] ffff888043c03338 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x70/0x680 [ 134.229907][ T5330] [ 134.229907][ T5330] which lock already depends on the new lock. [ 134.229907][ T5330] [ 134.233835][ T5330] [ 134.233835][ T5330] the existing dependency chain (in reverse order) is: [ 134.237914][ T5330] [ 134.237914][ T5330] -> #1 (&conn->lock#2){+.+.}-{4:4}: [ 134.241154][ T5330] lock_acquire+0x120/0x360 [ 134.243339][ T5330] __mutex_lock+0x187/0x1350 [ 134.245523][ T5330] l2cap_info_timeout+0x60/0xa0 [ 134.247782][ T5330] process_scheduled_works+0xae1/0x17b0 [ 134.250130][ T5330] worker_thread+0x8a0/0xda0 [ 134.252215][ T5330] kthread+0x711/0x8a0 [ 134.254015][ T5330] ret_from_fork+0x4bc/0x870 [ 134.256031][ T5330] ret_from_fork_asm+0x1a/0x30 [ 134.258078][ T5330] [ 134.258078][ T5330] -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: [ 134.261949][ T5330] validate_chain+0xb9b/0x2140 [ 134.264048][ T5330] __lock_acquire+0xab9/0xd20 [ 134.266024][ T5330] lock_acquire+0x120/0x360 [ 134.267995][ T5330] __flush_work+0x6b8/0xbc0 [ 134.270012][ T5330] __cancel_work_sync+0xbe/0x110 [ 134.271997][ T5330] l2cap_conn_del+0x4f0/0x680 [ 134.273992][ T5330] hci_conn_hash_flush+0x10d/0x230 [ 134.276244][ T5330] hci_dev_close_sync+0xaef/0x1330 [ 134.278675][ T5330] hci_dev_close+0x108/0x200 [ 134.280856][ T5330] sock_do_ioctl+0xd9/0x300 [ 134.282931][ T5330] sock_ioctl+0x576/0x790 [ 134.284778][ T5330] __se_sys_ioctl+0xfc/0x170 [ 134.286909][ T5330] do_syscall_64+0xfa/0xfa0 [ 134.288975][ T5330] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 134.291242][ T5330] [ 134.291242][ T5330] other info that might help us debug this: [ 134.291242][ T5330] [ 134.295584][ T5330] Possible unsafe locking scenario: [ 134.295584][ T5330] [ 134.298825][ T5330] CPU0 CPU1 [ 134.301110][ T5330] ---- ---- [ 134.303302][ T5330] lock(&conn->lock#2); [ 134.305056][ T5330] lock((work_completion)(&(&conn->info_timer)->work)); [ 134.308885][ T5330] lock(&conn->lock#2); [ 134.311548][ T5330] lock((work_completion)(&(&conn->info_timer)->work)); [ 134.314262][ T5330] [ 134.314262][ T5330] *** DEADLOCK *** [ 134.314262][ T5330] [ 134.317740][ T5330] 5 locks held by syz.0.0/5330: [ 134.319915][ T5330] #0: ffff8880361dcdc8 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_close+0x100/0x200 [ 134.323467][ T5330] #1: ffff8880361dc0b8 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x66a/0x1330 [ 134.327093][ T5330] #2: ffffffff8f64af68 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x230 [ 134.331027][ T5330] #3: ffff888043c03338 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x70/0x680 [ 134.334642][ T5330] #4: ffffffff8e13d320 (rcu_read_lock){....}-{1:3}, at: __flush_work+0xd2/0xbc0 [ 134.338056][ T5330] [ 134.338056][ T5330] stack backtrace: [ 134.340378][ T5330] CPU: 0 UID: 0 PID: 5330 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 134.340392][ T5330] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 134.340398][ T5330] Call Trace: [ 134.340403][ T5330] [ 134.340408][ T5330] dump_stack_lvl+0x189/0x250 [ 134.340420][ T5330] ? __pfx_dump_stack_lvl+0x10/0x10 [ 134.340428][ T5330] ? __pfx__printk+0x10/0x10 [ 134.340436][ T5330] ? print_lock_name+0xde/0x100 [ 134.340443][ T5330] print_circular_bug+0x2ee/0x310 [ 134.340452][ T5330] check_noncircular+0x134/0x160 [ 134.340463][ T5330] validate_chain+0xb9b/0x2140 [ 134.340470][ T5330] ? do_raw_spin_lock+0x121/0x290 [ 134.340480][ T5330] ? look_up_lock_class+0x74/0x170 [ 134.340489][ T5330] ? register_lock_class+0x51/0x320 [ 134.340496][ T5330] __lock_acquire+0xab9/0xd20 [ 134.340504][ T5330] ? __flush_work+0xd2/0xbc0 [ 134.340512][ T5330] lock_acquire+0x120/0x360 [ 134.340518][ T5330] ? __flush_work+0xd2/0xbc0 [ 134.340527][ T5330] ? _raw_spin_unlock_irq+0x23/0x50 [ 134.340534][ T5330] ? __flush_work+0xd2/0xbc0 [ 134.340540][ T5330] __flush_work+0x6b8/0xbc0 [ 134.340547][ T5330] ? __flush_work+0xd2/0xbc0 [ 134.340554][ T5330] ? __flush_work+0xd2/0xbc0 [ 134.340561][ T5330] ? __pfx___flush_work+0x10/0x10 [ 134.340568][ T5330] ? __pfx_wq_barrier_func+0x10/0x10 [ 134.340577][ T5330] ? __pfx___cancel_work+0x10/0x10 [ 134.340585][ T5330] ? hci_conn_drop+0x14d/0x280 [ 134.340596][ T5330] __cancel_work_sync+0xbe/0x110 [ 134.340609][ T5330] l2cap_conn_del+0x4f0/0x680 [ 134.340622][ T5330] ? __pfx_l2cap_disconn_cfm+0x10/0x10 [ 134.340635][ T5330] hci_conn_hash_flush+0x10d/0x230 [ 134.340649][ T5330] hci_dev_close_sync+0xaef/0x1330 [ 134.340663][ T5330] ? __pfx_hci_dev_close_sync+0x10/0x10 [ 134.340675][ T5330] ? do_raw_read_unlock+0x3d/0x80 [ 134.340691][ T5330] hci_dev_close+0x108/0x200 [ 134.340704][ T5330] sock_do_ioctl+0xd9/0x300 [ 134.340718][ T5330] ? __pfx_sock_do_ioctl+0x10/0x10 [ 134.340734][ T5330] sock_ioctl+0x576/0x790 [ 134.340746][ T5330] ? __pfx_sock_ioctl+0x10/0x10 [ 134.340758][ T5330] ? __fget_files+0x3a0/0x420 [ 134.340773][ T5330] ? __fget_files+0x2a/0x420 [ 134.340786][ T5330] ? bpf_lsm_file_ioctl+0x9/0x20 [ 134.340798][ T5330] ? __pfx_sock_ioctl+0x10/0x10 [ 134.340809][ T5330] __se_sys_ioctl+0xfc/0x170 [ 134.340820][ T5330] do_syscall_64+0xfa/0xfa0 [ 134.340833][ T5330] ? lockdep_hardirqs_on+0x9c/0x150 [ 134.340844][ T5330] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 134.340855][ T5330] ? clear_bhb_loop+0x60/0xb0 [ 134.340866][ T5330] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 134.340876][ T5330] RIP: 0033:0x7f812d98eec9 [ 134.340889][ T5330] 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 [ 134.340897][ T5330] RSP: 002b:00007f8129df5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 134.340909][ T5330] RAX: ffffffffffffffda RBX: 00007f812dbe6090 RCX: 00007f812d98eec9 [ 134.340917][ T5330] RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000005 [ 134.340924][ T5330] RBP: 00007f812da11f91 R08: 0000000000000000 R09: 0000000000000000 [ 134.340931][ T5330] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 134.340937][ T5330] R13: 00007f812dbe6128 R14: 00007f812dbe6090 R15: 00007ffe5f72b948 [ 134.340950][ T5330] [ 134.499926][ T4666] Bluetooth: hci0: command tx timeout [ 136.519405][ T4666] Bluetooth: hci0: command tx timeout [ 138.599332][ T4666] Bluetooth: hci0: command tx timeout