program: r0 = syz_init_net_socket$bt_hci(0x1f, 0x3, 0x1) r1 = syz_open_dev$tty1(0xc, 0x4, 0x1) ioctl$KDSETLED(r1, 0x4b32, 0x6) r2 = syz_init_net_socket$bt_l2cap(0x1f, 0x2, 0x0) connect$bt_l2cap(r2, &(0x7f0000000080)={0x1f, 0x0, @fixed={'\xaa\xaa\xaa\xaa\xaa', 0x10}, 0x7ff}, 0xe) r3 = syz_init_net_socket$bt_hidp(0x1f, 0x3, 0x6) ioctl$sock_bt_hidp_HIDPCONNADD(r3, 0x400448c8, &(0x7f00000000c0)={r2, r2, 0x206, 0x0, 0x0, 0x2, 0x72, 0x1, 0x3, 0x7, 0x0, 0x8, 'syz1\x00'}) ioctl$sock_bt_hci(r0, 0x400448ca, 0x0) [ 86.172492][ T5341] input: Bluetooth HID Boot Protocol Device as /devices/virtual/bluetooth/hci0/hci0:200/input5 [ 86.291985][ T5342] [ 86.293253][ T5342] ====================================================== [ 86.296151][ T5342] WARNING: possible circular locking dependency detected [ 86.298981][ T5342] syzkaller #0 Not tainted [ 86.300813][ T5342] ------------------------------------------------------ [ 86.303970][ T5342] syz.0.0/5342 is trying to acquire lock: [ 86.306808][ T5342] ffff8880111b4840 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0xd2/0xbc0 [ 86.311603][ T5342] [ 86.311603][ T5342] but task is already holding lock: [ 86.314730][ T5342] ffff8880111b4b38 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x70/0x680 [ 86.318571][ T5342] [ 86.318571][ T5342] which lock already depends on the new lock. [ 86.318571][ T5342] [ 86.322993][ T5342] [ 86.322993][ T5342] the existing dependency chain (in reverse order) is: [ 86.326676][ T5342] [ 86.326676][ T5342] -> #1 (&conn->lock#2){+.+.}-{4:4}: [ 86.329802][ T5342] __mutex_lock+0x187/0x1350 [ 86.332008][ T5342] l2cap_info_timeout+0x60/0xa0 [ 86.334269][ T5342] process_scheduled_works+0xad1/0x1770 [ 86.337142][ T5342] worker_thread+0x8a0/0xda0 [ 86.340040][ T5342] kthread+0x711/0x8a0 [ 86.342345][ T5342] ret_from_fork+0x599/0xb30 [ 86.344725][ T5342] ret_from_fork_asm+0x1a/0x30 [ 86.347274][ T5342] [ 86.347274][ T5342] -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: [ 86.351741][ T5342] __lock_acquire+0x15a6/0x2cf0 [ 86.354017][ T5342] lock_acquire+0x117/0x340 [ 86.356172][ T5342] __flush_work+0x6b8/0xbc0 [ 86.358474][ T5342] __cancel_work_sync+0xbe/0x110 [ 86.360801][ T5342] l2cap_conn_del+0x4f3/0x680 [ 86.363084][ T5342] hci_conn_hash_flush+0x10d/0x230 [ 86.365522][ T5342] hci_dev_close_sync+0x821/0xff0 [ 86.367894][ T5342] hci_dev_close+0x108/0x200 [ 86.370144][ T5342] sock_do_ioctl+0xdc/0x300 [ 86.372456][ T5342] sock_ioctl+0x576/0x790 [ 86.374537][ T5342] __se_sys_ioctl+0xfc/0x170 [ 86.376855][ T5342] do_syscall_64+0xfa/0xf80 [ 86.379076][ T5342] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.381751][ T5342] [ 86.381751][ T5342] other info that might help us debug this: [ 86.381751][ T5342] [ 86.385615][ T5342] Possible unsafe locking scenario: [ 86.385615][ T5342] [ 86.388528][ T5342] CPU0 CPU1 [ 86.390709][ T5342] ---- ---- [ 86.392878][ T5342] lock(&conn->lock#2); [ 86.394654][ T5342] lock((work_completion)(&(&conn->info_timer)->work)); [ 86.398442][ T5342] lock(&conn->lock#2); [ 86.401444][ T5342] lock((work_completion)(&(&conn->info_timer)->work)); [ 86.404464][ T5342] [ 86.404464][ T5342] *** DEADLOCK *** [ 86.404464][ T5342] [ 86.407988][ T5342] 5 locks held by syz.0.0/5342: [ 86.410096][ T5342] #0: ffff888045248ec0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_close+0x100/0x200 [ 86.413931][ T5342] #1: ffff8880452480c0 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x640/0xff0 [ 86.418051][ T5342] #2: ffffffff8f476848 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x230 [ 86.422294][ T5342] #3: ffff8880111b4b38 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x70/0x680 [ 86.426209][ T5342] #4: ffffffff8df41cc0 (rcu_read_lock){....}-{1:3}, at: __flush_work+0xd2/0xbc0 [ 86.430194][ T5342] [ 86.430194][ T5342] stack backtrace: [ 86.432733][ T5342] CPU: 0 UID: 0 PID: 5342 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 86.432751][ T5342] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 86.432765][ T5342] Call Trace: [ 86.432774][ T5342] [ 86.432779][ T5342] dump_stack_lvl+0x189/0x250 [ 86.432800][ T5342] ? __pfx_dump_stack_lvl+0x10/0x10 [ 86.432809][ T5342] ? __pfx__printk+0x10/0x10 [ 86.432820][ T5342] ? print_lock_name+0xde/0x100 [ 86.432831][ T5342] print_circular_bug+0x2e2/0x300 [ 86.432841][ T5342] check_noncircular+0x12e/0x150 [ 86.432850][ T5342] __lock_acquire+0x15a6/0x2cf0 [ 86.432858][ T5342] ? do_raw_spin_unlock+0x4d/0x240 [ 86.432868][ T5342] ? _raw_spin_unlock_irqrestore+0xad/0x110 [ 86.432877][ T5342] ? __pfx__raw_spin_unlock_irqrestore+0x10/0x10 [ 86.432886][ T5342] ? __flush_work+0xd2/0xbc0 [ 86.432894][ T5342] lock_acquire+0x117/0x340 [ 86.432901][ T5342] ? __flush_work+0xd2/0xbc0 [ 86.432908][ T5342] ? _raw_spin_unlock_irq+0x23/0x50 [ 86.432917][ T5342] ? __flush_work+0xd2/0xbc0 [ 86.432924][ T5342] __flush_work+0x6b8/0xbc0 [ 86.432936][ T5342] ? __flush_work+0xd2/0xbc0 [ 86.432946][ T5342] ? __flush_work+0xd2/0xbc0 [ 86.432957][ T5342] ? __pfx___flush_work+0x10/0x10 [ 86.432968][ T5342] ? __pfx_wq_barrier_func+0x10/0x10 [ 86.432981][ T5342] ? __pfx___cancel_work+0x10/0x10 [ 86.432993][ T5342] ? hci_conn_drop+0x153/0x280 [ 86.433003][ T5342] ? __cancel_work_sync+0x5c/0x110 [ 86.433016][ T5342] __cancel_work_sync+0xbe/0x110 [ 86.433024][ T5342] l2cap_conn_del+0x4f3/0x680 [ 86.433037][ T5342] ? __pfx_l2cap_disconn_cfm+0x10/0x10 [ 86.433046][ T5342] hci_conn_hash_flush+0x10d/0x230 [ 86.433056][ T5342] hci_dev_close_sync+0x821/0xff0 [ 86.433065][ T5342] ? __pfx_hci_dev_close_sync+0x10/0x10 [ 86.433073][ T5342] ? __cancel_work_sync+0x5c/0x110 [ 86.433081][ T5342] hci_dev_close+0x108/0x200 [ 86.433091][ T5342] sock_do_ioctl+0xdc/0x300 [ 86.433103][ T5342] ? __pfx_sock_do_ioctl+0x10/0x10 [ 86.433114][ T5342] ? count_memcg_event_mm+0x21/0x260 [ 86.433127][ T5342] sock_ioctl+0x576/0x790 [ 86.433140][ T5342] ? __pfx_sock_ioctl+0x10/0x10 [ 86.433153][ T5342] ? __fget_files+0x3a0/0x420 [ 86.433171][ T5342] ? __fget_files+0x2a/0x420 [ 86.433187][ T5342] ? bpf_lsm_file_ioctl+0x9/0x20 [ 86.433199][ T5342] ? __pfx_sock_ioctl+0x10/0x10 [ 86.433206][ T5342] __se_sys_ioctl+0xfc/0x170 [ 86.433215][ T5342] do_syscall_64+0xfa/0xf80 [ 86.433224][ T5342] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.433234][ T5342] ? clear_bhb_loop+0x60/0xb0 [ 86.433247][ T5342] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.433261][ T5342] RIP: 0033:0x7fda8718f7c9 [ 86.433274][ T5342] 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.433286][ T5342] RSP: 002b:00007fda88056038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 86.433300][ T5342] RAX: ffffffffffffffda RBX: 00007fda873e6090 RCX: 00007fda8718f7c9 [ 86.433308][ T5342] RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000004 [ 86.433315][ T5342] RBP: 00007fda87213f91 R08: 0000000000000000 R09: 0000000000000000 [ 86.433321][ T5342] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 86.433326][ T5342] R13: 00007fda873e6128 R14: 00007fda873e6090 R15: 00007ffc3803b7e8 [ 86.433337][ T5342] [ 86.577305][ T4681] Bluetooth: hci0: command tx timeout [ 88.597256][ T4681] Bluetooth: hci0: command tx timeout [ 90.677338][ T4681] Bluetooth: hci0: command tx timeout [ 91.641463][ T9] cfg80211: failed to load regulatory.db