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 = socket$nl_generic(0x10, 0x3, 0x10) sendmsg$nl_generic(r1, &(0x7f0000000040)={0x0, 0x0, &(0x7f0000000180)={&(0x7f0000000f80)={0x2c, 0x2c, 0x107, 0x0, 0x25dfdbff, {0x3, 0x7c}, [@nested={0x8, 0x1, 0x0, 0x1, [@typed={0x4, 0x6}]}, @nested={0x10, 0x2, 0x0, 0x1, [@nested={0xc, 0x1, 0x0, 0x1, [@nested={0x8, 0x8e, 0x0, 0x1, [@nested={0x4, 0xe9}]}]}]}]}, 0x2c}, 0x1, 0x0, 0x0, 0xc000}, 0xc010) r2 = syz_init_net_socket$bt_hci(0x1f, 0x3, 0x1) ioctl$HCIINQUIRY(r2, 0x400448ca, 0x0) [ 87.861400][ T47] Bluetooth: hci0: command tx timeout [ 87.986486][ T5341] [ 87.987575][ T5341] ====================================================== [ 87.990494][ T5341] WARNING: possible circular locking dependency detected [ 87.993536][ T5341] syzkaller #0 Not tainted [ 87.995542][ T5341] ------------------------------------------------------ [ 87.998625][ T5341] syz.0.0/5341 is trying to acquire lock: [ 88.000980][ T5341] ffff888011bff840 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0xd2/0xbc0 [ 88.005950][ T5341] [ 88.005950][ T5341] but task is already holding lock: [ 88.008777][ T5341] ffff888011bffb38 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5b0 [ 88.012403][ T5341] [ 88.012403][ T5341] which lock already depends on the new lock. [ 88.012403][ T5341] [ 88.016750][ T5341] [ 88.016750][ T5341] the existing dependency chain (in reverse order) is: [ 88.020452][ T5341] [ 88.020452][ T5341] -> #1 (&conn->lock#2){+.+.}-{4:4}: [ 88.023582][ T5341] __mutex_lock+0x187/0x1350 [ 88.025887][ T5341] l2cap_info_timeout+0x60/0xa0 [ 88.028298][ T5341] process_scheduled_works+0xad1/0x1770 [ 88.030820][ T5341] worker_thread+0x8a0/0xda0 [ 88.033053][ T5341] kthread+0x711/0x8a0 [ 88.035124][ T5341] ret_from_fork+0x599/0xb30 [ 88.037339][ T5341] ret_from_fork_asm+0x1a/0x30 [ 88.039669][ T5341] [ 88.039669][ T5341] -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: [ 88.043831][ T5341] __lock_acquire+0x15a6/0x2cf0 [ 88.046165][ T5341] lock_acquire+0x117/0x340 [ 88.047942][ T5341] __flush_work+0x6b8/0xbc0 [ 88.049906][ T5341] __cancel_work_sync+0xbe/0x110 [ 88.052019][ T5341] l2cap_conn_del+0x402/0x5b0 [ 88.054073][ T5341] hci_conn_hash_flush+0x10d/0x260 [ 88.056382][ T5341] hci_dev_close_sync+0x821/0x1100 [ 88.058550][ T5341] hci_dev_close+0x108/0x270 [ 88.060619][ T5341] sock_do_ioctl+0xdc/0x300 [ 88.062679][ T5341] sock_ioctl+0x576/0x790 [ 88.064873][ T5341] __se_sys_ioctl+0xfc/0x170 [ 88.067172][ T5341] do_syscall_64+0xfa/0xf80 [ 88.069383][ T5341] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 88.072173][ T5341] [ 88.072173][ T5341] other info that might help us debug this: [ 88.072173][ T5341] [ 88.076190][ T5341] Possible unsafe locking scenario: [ 88.076190][ T5341] [ 88.079297][ T5341] CPU0 CPU1 [ 88.081467][ T5341] ---- ---- [ 88.083711][ T5341] lock(&conn->lock#2); [ 88.085960][ T5341] lock((work_completion)(&(&conn->info_timer)->work)); [ 88.090609][ T5341] lock(&conn->lock#2); [ 88.093485][ T5341] lock((work_completion)(&(&conn->info_timer)->work)); [ 88.096468][ T5341] [ 88.096468][ T5341] *** DEADLOCK *** [ 88.096468][ T5341] [ 88.099835][ T5341] 5 locks held by syz.0.0/5341: [ 88.101913][ T5341] #0: ffff8880123d0ec0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_close+0x100/0x270 [ 88.105688][ T5341] #1: ffff8880123d00c0 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x640/0x1100 [ 88.109733][ T5341] #2: ffffffff8f6858c8 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x260 [ 88.113873][ T5341] #3: ffff888011bffb38 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5b0 [ 88.117529][ T5341] #4: ffffffff8e141a20 (rcu_read_lock){....}-{1:3}, at: __flush_work+0xd2/0xbc0 [ 88.121491][ T5341] [ 88.121491][ T5341] stack backtrace: [ 88.123923][ T5341] CPU: 0 UID: 0 PID: 5341 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 88.123940][ T5341] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 88.123949][ T5341] Call Trace: [ 88.123957][ T5341] [ 88.123963][ T5341] dump_stack_lvl+0x189/0x250 [ 88.123982][ T5341] ? __pfx_dump_stack_lvl+0x10/0x10 [ 88.123996][ T5341] ? __pfx__printk+0x10/0x10 [ 88.124013][ T5341] ? print_lock_name+0xde/0x100 [ 88.124030][ T5341] print_circular_bug+0x2e2/0x300 [ 88.124045][ T5341] check_noncircular+0x12e/0x150 [ 88.124060][ T5341] __lock_acquire+0x15a6/0x2cf0 [ 88.124073][ T5341] ? do_raw_spin_unlock+0x4d/0x240 [ 88.124088][ T5341] ? _raw_spin_unlock_irqrestore+0xad/0x110 [ 88.124104][ T5341] ? __pfx__raw_spin_unlock_irqrestore+0x10/0x10 [ 88.124121][ T5341] ? __flush_work+0xd2/0xbc0 [ 88.124132][ T5341] lock_acquire+0x117/0x340 [ 88.124142][ T5341] ? __flush_work+0xd2/0xbc0 [ 88.124156][ T5341] ? _raw_spin_unlock_irq+0x23/0x50 [ 88.124171][ T5341] ? __flush_work+0xd2/0xbc0 [ 88.124182][ T5341] __flush_work+0x6b8/0xbc0 [ 88.124195][ T5341] ? __flush_work+0xd2/0xbc0 [ 88.124207][ T5341] ? __flush_work+0xd2/0xbc0 [ 88.124220][ T5341] ? __pfx___flush_work+0x10/0x10 [ 88.124231][ T5341] ? __pfx_wq_barrier_func+0x10/0x10 [ 88.124251][ T5341] ? __pfx___cancel_work+0x10/0x10 [ 88.124269][ T5341] ? hci_conn_drop+0x153/0x2b0 [ 88.124281][ T5341] ? __cancel_work_sync+0x5c/0x110 [ 88.124295][ T5341] __cancel_work_sync+0xbe/0x110 [ 88.124310][ T5341] l2cap_conn_del+0x402/0x5b0 [ 88.124326][ T5341] ? __pfx_l2cap_disconn_cfm+0x10/0x10 [ 88.124343][ T5341] hci_conn_hash_flush+0x10d/0x260 [ 88.124360][ T5341] hci_dev_close_sync+0x821/0x1100 [ 88.124376][ T5341] ? __pfx_hci_dev_close_sync+0x10/0x10 [ 88.124390][ T5341] ? __cancel_work_sync+0x5c/0x110 [ 88.124404][ T5341] hci_dev_close+0x108/0x270 [ 88.124418][ T5341] sock_do_ioctl+0xdc/0x300 [ 88.124433][ T5341] ? __pfx_sock_do_ioctl+0x10/0x10 [ 88.124446][ T5341] ? do_futex+0x395/0x420 [ 88.124462][ T5341] sock_ioctl+0x576/0x790 [ 88.124477][ T5341] ? __pfx_sock_ioctl+0x10/0x10 [ 88.124490][ T5341] ? __fget_files+0x3a0/0x420 [ 88.124502][ T5341] ? __fget_files+0x2a/0x420 [ 88.124513][ T5341] ? bpf_lsm_file_ioctl+0x9/0x20 [ 88.124524][ T5341] ? __pfx_sock_ioctl+0x10/0x10 [ 88.124536][ T5341] __se_sys_ioctl+0xfc/0x170 [ 88.124552][ T5341] do_syscall_64+0xfa/0xf80 [ 88.124563][ T5341] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 88.124573][ T5341] ? clear_bhb_loop+0x60/0xb0 [ 88.124585][ T5341] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 88.124596][ T5341] RIP: 0033:0x7f3f7ff8f7c9 [ 88.124607][ T5341] 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 [ 88.124617][ T5341] RSP: 002b:00007f3f80e36038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 88.124629][ T5341] RAX: ffffffffffffffda RBX: 00007f3f801e6090 RCX: 00007f3f7ff8f7c9 [ 88.124638][ T5341] RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000006 [ 88.124646][ T5341] RBP: 00007f3f80013f91 R08: 0000000000000000 R09: 0000000000000000 [ 88.124653][ T5341] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 88.124660][ T5341] R13: 00007f3f801e6128 R14: 00007f3f801e6090 R15: 00007ffdb2852538 [ 88.124671][ T5341] [ 89.932789][ T47] Bluetooth: hci0: command tx timeout [ 91.789010][ T1238] cfg80211: failed to load regulatory.db [ 92.013382][ T47] Bluetooth: hci0: command tx timeout