program: r0 = syz_init_net_socket$bt_l2cap(0x1f, 0x2, 0x0) connect$bt_l2cap(r0, &(0x7f0000000080)={0x1f, 0x0, @fixed={'\xaa\xaa\xaa\xaa\xaa', 0x10}, 0x7ff}, 0xe) r1 = syz_init_net_socket$bt_hidp(0x1f, 0x3, 0x6) r2 = openat$binderfs(0xffffffffffffff9c, &(0x7f0000000040)='./binderfs2/custom0\x00', 0x2, 0x0) r3 = mmap$binder(&(0x7f0000ffd000/0x1000)=nil, 0x1000, 0x1, 0x11, r1, 0x0) ioctl$BINDER_WRITE_READ(r2, 0xc0306201, &(0x7f0000000300)={0x68, 0x0, &(0x7f0000000240)=[@reply_sg={0x40486312, {0x3, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x50, 0x18, &(0x7f00000000c0)={@flat=@weak_handle={0x77682a85, 0x10a}, @fda={0x66646185, 0x5, 0x0, 0x32}, @flat=@handle={0x73682a85, 0x14, 0x2}}, &(0x7f0000000140)={0x0, 0x18, 0x38}}, 0x1000}, @free_buffer={0x40086303, r3}, @clear_death={0x400c630f, 0x1}], 0x1, 0x0, &(0x7f00000002c0)="d6"}) timer_create(0x3, 0x0, &(0x7f0000000000)=0x0) timer_settime(0x0, 0x0, &(0x7f000006b000)={{0x0, 0x8}, {0x0, 0x9}}, 0x0) timer_gettime(r4, &(0x7f0000000040)) ioctl$sock_bt_hidp_HIDPCONNADD(r1, 0x400448c8, &(0x7f0000000180)={r0, r0, 0x8, 0x0, 0x0, 0x82, 0x4a, 0x15c2, 0x5886, 0x6, 0x0, 0x8, 'syz1\x00'}) r5 = openat$cgroup_ro(0xffffffffffffff9c, &(0x7f0000000240)='cpuacct.usage_percpu\x00', 0x275a, 0x0) write$binfmt_script(r5, &(0x7f00000005c0)={'#! ', './file0/file0'}, 0x11) mmap(&(0x7f0000000000/0xb36000)=nil, 0xb36000, 0x2, 0x28011, r5, 0x0) mkdirat(r5, &(0x7f0000000340)='./file0\x00', 0x8) r6 = syz_init_net_socket$bt_hci(0x1f, 0x3, 0x1) ioctl$sock_bt_hci(r6, 0x400448ca, 0x0) r7 = syz_clone(0x0, 0x0, 0x0, 0x0, 0x0, 0x0) ptrace(0x10, r7) socket$kcm(0x29, 0x2, 0x0) ptrace$getregset(0x4204, r7, 0x4, &(0x7f0000000380)={0x0}) ptrace$ARCH_SET_GS(0x1e, r7, &(0x7f00000003c0), 0x1001) [ 93.762310][ T47] Bluetooth: hci0: command tx timeout [ 93.771609][ T786] cfg80211: failed to load regulatory.db [ 93.907530][ T5338] input: Bluetooth HID Boot Protocol Device as /devices/virtual/bluetooth/hci0/hci0:200/input5 [ 94.034395][ T5339] [ 94.035321][ T5339] ====================================================== [ 94.038251][ T5339] WARNING: possible circular locking dependency detected [ 94.041352][ T5339] syzkaller #0 Not tainted [ 94.043281][ T5339] ------------------------------------------------------ [ 94.046514][ T5339] syz.0.0/5339 is trying to acquire lock: [ 94.049666][ T5339] ffff888040e73040 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0xd2/0xbc0 [ 94.054645][ T5339] [ 94.054645][ T5339] but task is already holding lock: [ 94.057922][ T5339] ffff888040e73338 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5b0 [ 94.061861][ T5339] [ 94.061861][ T5339] which lock already depends on the new lock. [ 94.061861][ T5339] [ 94.066356][ T5339] [ 94.066356][ T5339] the existing dependency chain (in reverse order) is: [ 94.070267][ T5339] [ 94.070267][ T5339] -> #1 (&conn->lock#2){+.+.}-{4:4}: [ 94.073394][ T5339] __mutex_lock+0x187/0x1350 [ 94.075505][ T5339] l2cap_info_timeout+0x60/0xa0 [ 94.077774][ T5339] process_scheduled_works+0xad1/0x1770 [ 94.080310][ T5339] worker_thread+0x8a0/0xda0 [ 94.082423][ T5339] kthread+0x711/0x8a0 [ 94.084265][ T5339] ret_from_fork+0x599/0xb30 [ 94.086349][ T5339] ret_from_fork_asm+0x1a/0x30 [ 94.088611][ T5339] [ 94.088611][ T5339] -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: [ 94.092923][ T5339] __lock_acquire+0x15a6/0x2cf0 [ 94.095069][ T5339] lock_acquire+0x117/0x340 [ 94.097242][ T5339] __flush_work+0x6b8/0xbc0 [ 94.099331][ T5339] __cancel_work_sync+0xbe/0x110 [ 94.101607][ T5339] l2cap_conn_del+0x402/0x5b0 [ 94.103693][ T5339] hci_conn_hash_flush+0x10d/0x260 [ 94.106001][ T5339] hci_dev_close_sync+0x821/0x1100 [ 94.108325][ T5339] hci_dev_close+0x108/0x270 [ 94.110463][ T5339] sock_do_ioctl+0xdc/0x300 [ 94.112506][ T5339] sock_ioctl+0x576/0x790 [ 94.114591][ T5339] __se_sys_ioctl+0xfc/0x170 [ 94.116695][ T5339] do_syscall_64+0xfa/0xf80 [ 94.118634][ T5339] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 94.121281][ T5339] [ 94.121281][ T5339] other info that might help us debug this: [ 94.121281][ T5339] [ 94.125469][ T5339] Possible unsafe locking scenario: [ 94.125469][ T5339] [ 94.128498][ T5339] CPU0 CPU1 [ 94.130644][ T5339] ---- ---- [ 94.132757][ T5339] lock(&conn->lock#2); [ 94.134406][ T5339] lock((work_completion)(&(&conn->info_timer)->work)); [ 94.138205][ T5339] lock(&conn->lock#2); [ 94.140944][ T5339] lock((work_completion)(&(&conn->info_timer)->work)); [ 94.143728][ T5339] [ 94.143728][ T5339] *** DEADLOCK *** [ 94.143728][ T5339] [ 94.147283][ T5339] 5 locks held by syz.0.0/5339: [ 94.149439][ T5339] #0: ffff88801f6d4ec0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_close+0x100/0x270 [ 94.153542][ T5339] #1: ffff88801f6d40c0 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x640/0x1100 [ 94.157846][ T5339] #2: ffffffff8f67b588 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x260 [ 94.162074][ T5339] #3: ffff888040e73338 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5b0 [ 94.166141][ T5339] #4: ffffffff8e1419e0 (rcu_read_lock){....}-{1:3}, at: __flush_work+0xd2/0xbc0 [ 94.170198][ T5339] [ 94.170198][ T5339] stack backtrace: [ 94.172825][ T5339] CPU: 0 UID: 0 PID: 5339 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 94.172836][ T5339] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 94.172841][ T5339] Call Trace: [ 94.172853][ T5339] [ 94.172857][ T5339] dump_stack_lvl+0x189/0x250 [ 94.172870][ T5339] ? __pfx_dump_stack_lvl+0x10/0x10 [ 94.172883][ T5339] ? __pfx__printk+0x10/0x10 [ 94.172900][ T5339] ? print_lock_name+0xde/0x100 [ 94.172915][ T5339] print_circular_bug+0x2e2/0x300 [ 94.172930][ T5339] check_noncircular+0x12e/0x150 [ 94.172944][ T5339] __lock_acquire+0x15a6/0x2cf0 [ 94.172955][ T5339] ? do_raw_spin_unlock+0x4d/0x240 [ 94.172968][ T5339] ? _raw_spin_unlock_irqrestore+0xad/0x110 [ 94.172981][ T5339] ? __pfx__raw_spin_unlock_irqrestore+0x10/0x10 [ 94.172994][ T5339] ? __flush_work+0xd2/0xbc0 [ 94.173005][ T5339] lock_acquire+0x117/0x340 [ 94.173015][ T5339] ? __flush_work+0xd2/0xbc0 [ 94.173028][ T5339] ? _raw_spin_unlock_irq+0x23/0x50 [ 94.173037][ T5339] ? __flush_work+0xd2/0xbc0 [ 94.173048][ T5339] __flush_work+0x6b8/0xbc0 [ 94.173058][ T5339] ? __flush_work+0xd2/0xbc0 [ 94.173070][ T5339] ? __flush_work+0xd2/0xbc0 [ 94.173081][ T5339] ? __pfx___flush_work+0x10/0x10 [ 94.173094][ T5339] ? __pfx_wq_barrier_func+0x10/0x10 [ 94.173107][ T5339] ? __pfx___cancel_work+0x10/0x10 [ 94.173119][ T5339] ? hci_conn_drop+0x153/0x2b0 [ 94.173134][ T5339] ? __cancel_work_sync+0x5c/0x110 [ 94.173146][ T5339] __cancel_work_sync+0xbe/0x110 [ 94.173159][ T5339] l2cap_conn_del+0x402/0x5b0 [ 94.173172][ T5339] ? __pfx_l2cap_disconn_cfm+0x10/0x10 [ 94.173183][ T5339] hci_conn_hash_flush+0x10d/0x260 [ 94.173195][ T5339] hci_dev_close_sync+0x821/0x1100 [ 94.173207][ T5339] ? __pfx_hci_dev_close_sync+0x10/0x10 [ 94.173217][ T5339] ? __cancel_work_sync+0x5c/0x110 [ 94.173231][ T5339] hci_dev_close+0x108/0x270 [ 94.173242][ T5339] sock_do_ioctl+0xdc/0x300 [ 94.173252][ T5339] ? __pfx_sock_do_ioctl+0x10/0x10 [ 94.173261][ T5339] ? do_futex+0x395/0x420 [ 94.173275][ T5339] sock_ioctl+0x576/0x790 [ 94.173291][ T5339] ? __pfx_sock_ioctl+0x10/0x10 [ 94.173306][ T5339] ? __fget_files+0x3a0/0x420 [ 94.173317][ T5339] ? __fget_files+0x2a/0x420 [ 94.173328][ T5339] ? bpf_lsm_file_ioctl+0x9/0x20 [ 94.173339][ T5339] ? __pfx_sock_ioctl+0x10/0x10 [ 94.173353][ T5339] __se_sys_ioctl+0xfc/0x170 [ 94.173368][ T5339] do_syscall_64+0xfa/0xf80 [ 94.173381][ T5339] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 94.173392][ T5339] ? clear_bhb_loop+0x60/0xb0 [ 94.173404][ T5339] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 94.173415][ T5339] RIP: 0033:0x7fc010b8f7c9 [ 94.173427][ T5339] 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 [ 94.173436][ T5339] RSP: 002b:00007fc0119b5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 94.173449][ T5339] RAX: ffffffffffffffda RBX: 00007fc010de6090 RCX: 00007fc010b8f7c9 [ 94.173457][ T5339] RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000007 [ 94.173464][ T5339] RBP: 00007fc010c13f91 R08: 0000000000000000 R09: 0000000000000000 [ 94.173471][ T5339] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 94.173478][ T5339] R13: 00007fc010de6128 R14: 00007fc010de6090 R15: 00007ffd195ddca8 [ 94.173488][ T5339] [ 95.780228][ T47] Bluetooth: hci0: command tx timeout [ 97.860796][ T47] Bluetooth: hci0: command tx timeout [ 99.940000][ T47] Bluetooth: hci0: command tx timeout