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) ioctl$sock_bt_hidp_HIDPCONNADD(r1, 0x400448c8, &(0x7f0000000340)={r0, r0, 0x8, 0x0, 0x0, 0xb, 0x1, 0xb57, 0xfff9, 0x3, 0x0, 0x8, 'syz0\x00'}) r2 = syz_init_net_socket$bt_hci(0x1f, 0x3, 0x1) ioctl$sock_bt_hci(r2, 0x400448ca, 0x0) (fail_nth: 4) [ 119.651955][ T5309] Bluetooth: hci0: command tx timeout [ 119.736352][ T5329] input: Bluetooth HID Boot Protocol Device as /devices/virtual/bluetooth/hci0/hci0:200/input5 [ 119.894541][ T5330] [ 119.895847][ T5330] ====================================================== [ 119.899359][ T5330] WARNING: possible circular locking dependency detected [ 119.902613][ T5330] syzkaller #0 Not tainted [ 119.904519][ T5330] ------------------------------------------------------ [ 119.908233][ T5330] syz.0.0/5330 is trying to acquire lock: [ 119.911759][ T5330] ffff88801a9d3840 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0x100/0xc50 [ 119.917363][ T5330] [ 119.917363][ T5330] but task is already holding lock: [ 119.920882][ T5330] ffff88801a9d3af8 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5c0 [ 119.925662][ T5330] [ 119.925662][ T5330] which lock already depends on the new lock. [ 119.925662][ T5330] [ 119.931051][ T5330] [ 119.931051][ T5330] the existing dependency chain (in reverse order) is: [ 119.935102][ T5330] [ 119.935102][ T5330] -> #1 (&conn->lock#2){+.+.}-{4:4}: [ 119.938267][ T5330] __mutex_lock+0x19f/0x1300 [ 119.940778][ T5330] l2cap_info_timeout+0x60/0xa0 [ 119.943605][ T5330] process_scheduled_works+0xb6e/0x18c0 [ 119.946617][ T5330] worker_thread+0xa53/0xfc0 [ 119.948982][ T5330] kthread+0x388/0x470 [ 119.951121][ T5330] ret_from_fork+0x51e/0xb90 [ 119.953520][ T5330] ret_from_fork_asm+0x1a/0x30 [ 119.956173][ T5330] [ 119.956173][ T5330] -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: [ 119.961254][ T5330] __lock_acquire+0x15a5/0x2cf0 [ 119.963703][ T5330] lock_acquire+0xf0/0x2e0 [ 119.965915][ T5330] __flush_work+0x700/0xc50 [ 119.968237][ T5330] __cancel_work_sync+0xbe/0x110 [ 119.970819][ T5330] l2cap_conn_del+0x40f/0x5c0 [ 119.973341][ T5330] hci_conn_hash_flush+0x10d/0x260 [ 119.976516][ T5330] hci_dev_close_sync+0x821/0x10e0 [ 119.979412][ T5330] hci_dev_close+0x108/0x260 [ 119.981807][ T5330] sock_do_ioctl+0x101/0x320 [ 119.984155][ T5330] sock_ioctl+0x5c6/0x7f0 [ 119.986380][ T5330] __se_sys_ioctl+0xfc/0x170 [ 119.988593][ T5330] do_syscall_64+0x14d/0xf80 [ 119.991433][ T5330] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 119.994759][ T5330] [ 119.994759][ T5330] other info that might help us debug this: [ 119.994759][ T5330] [ 119.999001][ T5330] Possible unsafe locking scenario: [ 119.999001][ T5330] [ 120.002235][ T5330] CPU0 CPU1 [ 120.004565][ T5330] ---- ---- [ 120.007347][ T5330] lock(&conn->lock#2); [ 120.009663][ T5330] lock((work_completion)(&(&conn->info_timer)->work)); [ 120.014208][ T5330] lock(&conn->lock#2); [ 120.017304][ T5330] lock((work_completion)(&(&conn->info_timer)->work)); [ 120.020426][ T5330] [ 120.020426][ T5330] *** DEADLOCK *** [ 120.020426][ T5330] [ 120.024380][ T5330] 5 locks held by syz.0.0/5330: [ 120.026974][ T5330] #0: ffff888043454ec0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_close+0x100/0x260 [ 120.031250][ T5330] #1: ffff8880434540c0 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x640/0x10e0 [ 120.035290][ T5330] #2: ffffffff8fd5c868 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x260 [ 120.040961][ T5330] #3: ffff88801a9d3af8 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5c0 [ 120.045614][ T5330] #4: ffffffff8e75e460 (rcu_read_lock){....}-{1:3}, at: __flush_work+0x100/0xc50 [ 120.049748][ T5330] [ 120.049748][ T5330] stack backtrace: [ 120.052286][ T5330] CPU: 0 UID: 0 PID: 5330 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 120.052304][ T5330] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 120.052312][ T5330] Call Trace: [ 120.052320][ T5330] [ 120.052326][ T5330] dump_stack_lvl+0xe8/0x150 [ 120.052347][ T5330] print_circular_bug+0x2e1/0x300 [ 120.052365][ T5330] check_noncircular+0x12e/0x150 [ 120.052381][ T5330] __lock_acquire+0x15a5/0x2cf0 [ 120.052395][ T5330] ? do_raw_spin_lock+0x12b/0x2f0 [ 120.052409][ T5330] ? do_raw_spin_unlock+0x4d/0x210 [ 120.052422][ T5330] lock_acquire+0xf0/0x2e0 [ 120.052436][ T5330] ? __flush_work+0x100/0xc50 [ 120.052454][ T5330] ? __flush_work+0x100/0xc50 [ 120.052495][ T5330] __flush_work+0x700/0xc50 [ 120.052510][ T5330] ? __flush_work+0x100/0xc50 [ 120.052525][ T5330] ? __flush_work+0x100/0xc50 [ 120.052540][ T5330] ? __pfx___flush_work+0x10/0x10 [ 120.052556][ T5330] ? __pfx_wq_barrier_func+0x10/0x10 [ 120.052573][ T5330] ? __cancel_work_sync+0x5c/0x110 [ 120.052589][ T5330] __cancel_work_sync+0xbe/0x110 [ 120.052608][ T5330] l2cap_conn_del+0x40f/0x5c0 [ 120.052627][ T5330] ? __pfx_l2cap_disconn_cfm+0x10/0x10 [ 120.052641][ T5330] hci_conn_hash_flush+0x10d/0x260 [ 120.052685][ T5330] hci_dev_close_sync+0x821/0x10e0 [ 120.052701][ T5330] ? __pfx_hci_dev_close_sync+0x10/0x10 [ 120.052716][ T5330] ? lockdep_hardirqs_on+0x7a/0x110 [ 120.052728][ T5330] ? enable_work+0x1fd/0x230 [ 120.052744][ T5330] hci_dev_close+0x108/0x260 [ 120.052759][ T5330] sock_do_ioctl+0x101/0x320 [ 120.052780][ T5330] ? __pfx_sock_do_ioctl+0x10/0x10 [ 120.052792][ T5330] ? __mutex_unlock_slowpath+0x1bd/0x7d0 [ 120.052806][ T5330] sock_ioctl+0x5c6/0x7f0 [ 120.052819][ T5330] ? __pfx_sock_ioctl+0x10/0x10 [ 120.052831][ T5330] ? __fget_files+0x2a/0x420 [ 120.052846][ T5330] ? __fget_files+0x3a0/0x420 [ 120.052859][ T5330] ? __fget_files+0x2a/0x420 [ 120.052874][ T5330] ? bpf_lsm_file_ioctl+0x9/0x20 [ 120.052903][ T5330] ? __pfx_sock_ioctl+0x10/0x10 [ 120.052915][ T5330] __se_sys_ioctl+0xfc/0x170 [ 120.052927][ T5330] do_syscall_64+0x14d/0xf80 [ 120.052939][ T5330] ? trace_irq_disable+0x3b/0x150 [ 120.052957][ T5330] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 120.052968][ T5330] ? clear_bhb_loop+0x40/0x90 [ 120.052980][ T5330] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 120.052991][ T5330] RIP: 0033:0x7eff2159c799 [ 120.053004][ T5330] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 [ 120.053020][ T5330] RSP: 002b:00007eff22385fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 120.053038][ T5330] RAX: ffffffffffffffda RBX: 00007eff21816090 RCX: 00007eff2159c799 [ 120.053047][ T5330] RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000006 [ 120.053054][ T5330] RBP: 00007eff22386050 R08: 0000000000000000 R09: 0000000000000000 [ 120.053061][ T5330] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 120.053068][ T5330] R13: 00007eff21816128 R14: 00007eff21816090 R15: 00007ffc4be0d958 [ 120.053078][ T5330] [ 121.681390][ T4666] Bluetooth: hci0: command tx timeout [ 123.761844][ T4666] Bluetooth: hci0: command tx timeout [ 125.842172][ T4666] Bluetooth: hci0: command tx timeout