program: r0 = syz_open_dev$tty1(0xc, 0x4, 0x1) ioctl$KDSETLED(r0, 0x4b32, 0x6) r1 = syz_init_net_socket$bt_l2cap(0x1f, 0x2, 0x0) connect$bt_l2cap(r1, &(0x7f0000000080)={0x1f, 0x0, @fixed={'\xaa\xaa\xaa\xaa\xaa', 0x10}, 0x7ff}, 0xe) r2 = socket$nl_route(0x10, 0x3, 0x0) r3 = socket$vsock_stream(0x28, 0x1, 0x0) getsockname(r3, &(0x7f0000000200)=@ll={0x11, 0x0, 0x0, 0x1, 0x0, 0x6, @link_local}, &(0x7f0000000040)=0x80) sendmsg$nl_route_sched(r2, &(0x7f0000000180)={0x0, 0x0, &(0x7f0000000140)={&(0x7f0000000a40)=@newchain={0x24, 0x64, 0x331, 0x70bd2b, 0x25dfdbff, {0x0, 0x0, 0x0, r4, {0xd, 0x8}, {0xc, 0xd}, {0x0, 0xb}}}, 0x24}, 0x1, 0x0, 0x0, 0x804}, 0x4000000) r5 = syz_init_net_socket$bt_hidp(0x1f, 0x3, 0x6) ioctl$sock_bt_hidp_HIDPCONNADD(r5, 0x400448c8, &(0x7f00000000c0)={r1, r1, 0x206, 0x0, 0x0, 0x2, 0x72, 0x1, 0x3, 0x7, 0x0, 0x8, 'syz1\x00'}) r6 = syz_init_net_socket$bt_hci(0x1f, 0x3, 0x1) ioctl$HCIINQUIRY(r6, 0x400448ca, 0x0) [ 86.019408][ T5344] input: Bluetooth HID Boot Protocol Device as /devices/virtual/bluetooth/hci0/hci0:200/input5 [ 86.113448][ T5345] [ 86.114579][ T5345] ====================================================== [ 86.117641][ T5345] WARNING: possible circular locking dependency detected [ 86.120711][ T5345] syzkaller #0 Not tainted [ 86.122802][ T5345] ------------------------------------------------------ [ 86.125765][ T5345] syz.0.0/5345 is trying to acquire lock: [ 86.128170][ T5345] ffff888040d81840 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0xd2/0xbc0 [ 86.132801][ T5345] [ 86.132801][ T5345] but task is already holding lock: [ 86.135874][ T5345] ffff888040d81b38 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5b0 [ 86.139896][ T5345] [ 86.139896][ T5345] which lock already depends on the new lock. [ 86.139896][ T5345] [ 86.144558][ T5345] [ 86.144558][ T5345] the existing dependency chain (in reverse order) is: [ 86.148779][ T5345] [ 86.148779][ T5345] -> #1 (&conn->lock#2){+.+.}-{4:4}: [ 86.152954][ T5345] __mutex_lock+0x187/0x1350 [ 86.155239][ T5345] l2cap_info_timeout+0x60/0xa0 [ 86.157313][ T5345] process_scheduled_works+0xad1/0x1770 [ 86.159745][ T5345] worker_thread+0x8a0/0xda0 [ 86.162088][ T5345] kthread+0x711/0x8a0 [ 86.164093][ T5345] ret_from_fork+0x510/0xa50 [ 86.166386][ T5345] ret_from_fork_asm+0x1a/0x30 [ 86.168675][ T5345] [ 86.168675][ T5345] -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: [ 86.173116][ T5345] __lock_acquire+0x15a6/0x2cf0 [ 86.175510][ T5345] lock_acquire+0x107/0x340 [ 86.177816][ T5345] __flush_work+0x6b8/0xbc0 [ 86.180112][ T5345] __cancel_work_sync+0xbe/0x110 [ 86.182513][ T5345] l2cap_conn_del+0x402/0x5b0 [ 86.184646][ T5345] hci_conn_hash_flush+0x10d/0x260 [ 86.186877][ T5345] hci_dev_close_sync+0x821/0x1100 [ 86.189223][ T5345] hci_dev_close+0x108/0x270 [ 86.191281][ T5345] sock_do_ioctl+0xdc/0x300 [ 86.193460][ T5345] sock_ioctl+0x576/0x790 [ 86.195531][ T5345] __se_sys_ioctl+0xfc/0x170 [ 86.197616][ T5345] do_syscall_64+0xec/0xf80 [ 86.199641][ T5345] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.202353][ T5345] [ 86.202353][ T5345] other info that might help us debug this: [ 86.202353][ T5345] [ 86.206711][ T5345] Possible unsafe locking scenario: [ 86.206711][ T5345] [ 86.209924][ T5345] CPU0 CPU1 [ 86.212243][ T5345] ---- ---- [ 86.214330][ T5345] lock(&conn->lock#2); [ 86.215887][ T5345] lock((work_completion)(&(&conn->info_timer)->work)); [ 86.219540][ T5345] lock(&conn->lock#2); [ 86.222304][ T5345] lock((work_completion)(&(&conn->info_timer)->work)); [ 86.225200][ T5345] [ 86.225200][ T5345] *** DEADLOCK *** [ 86.225200][ T5345] [ 86.228453][ T5345] 5 locks held by syz.0.0/5345: [ 86.230432][ T5345] #0: ffff888011178ec0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_close+0x100/0x270 [ 86.234426][ T5345] #1: ffff8880111780c0 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x640/0x1100 [ 86.238335][ T5345] #2: ffffffff8f485c88 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x260 [ 86.242366][ T5345] #3: ffff888040d81b38 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5b0 [ 86.246147][ T5345] #4: ffffffff8df41aa0 (rcu_read_lock){....}-{1:3}, at: __flush_work+0xd2/0xbc0 [ 86.249900][ T5345] [ 86.249900][ T5345] stack backtrace: [ 86.252381][ T5345] CPU: 0 UID: 0 PID: 5345 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 86.252394][ T5345] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 86.252399][ T5345] Call Trace: [ 86.252405][ T5345] [ 86.252409][ T5345] dump_stack_lvl+0xe8/0x150 [ 86.252422][ T5345] print_circular_bug+0x2e2/0x300 [ 86.252433][ T5345] check_noncircular+0x12e/0x150 [ 86.252442][ T5345] __lock_acquire+0x15a6/0x2cf0 [ 86.252451][ T5345] ? do_raw_spin_lock+0x121/0x290 [ 86.252462][ T5345] ? __flush_work+0xd2/0xbc0 [ 86.252475][ T5345] lock_acquire+0x107/0x340 [ 86.252484][ T5345] ? __flush_work+0xd2/0xbc0 [ 86.252495][ T5345] ? __flush_work+0xd2/0xbc0 [ 86.252506][ T5345] __flush_work+0x6b8/0xbc0 [ 86.252516][ T5345] ? __flush_work+0xd2/0xbc0 [ 86.252526][ T5345] ? __flush_work+0xd2/0xbc0 [ 86.252538][ T5345] ? __pfx___flush_work+0x10/0x10 [ 86.252549][ T5345] ? __pfx_wq_barrier_func+0x10/0x10 [ 86.252562][ T5345] ? __cancel_work_sync+0x5c/0x110 [ 86.252574][ T5345] __cancel_work_sync+0xbe/0x110 [ 86.252584][ T5345] l2cap_conn_del+0x402/0x5b0 [ 86.252600][ T5345] ? __pfx_l2cap_disconn_cfm+0x10/0x10 [ 86.252614][ T5345] hci_conn_hash_flush+0x10d/0x260 [ 86.252631][ T5345] hci_dev_close_sync+0x821/0x1100 [ 86.252645][ T5345] ? __pfx_hci_dev_close_sync+0x10/0x10 [ 86.252654][ T5345] ? lockdep_hardirqs_on+0x7b/0x110 [ 86.252660][ T5345] ? enable_work+0x1e9/0x220 [ 86.252668][ T5345] hci_dev_close+0x108/0x270 [ 86.252678][ T5345] sock_do_ioctl+0xdc/0x300 [ 86.252690][ T5345] ? __pfx_sock_do_ioctl+0x10/0x10 [ 86.252702][ T5345] ? do_futex+0x333/0x420 [ 86.252711][ T5345] ? call_rcu+0x644/0x890 [ 86.252726][ T5345] sock_ioctl+0x576/0x790 [ 86.252737][ T5345] ? __pfx_sock_ioctl+0x10/0x10 [ 86.252746][ T5345] ? __fget_files+0x2a/0x420 [ 86.252756][ T5345] ? __fget_files+0x3a0/0x420 [ 86.252765][ T5345] ? __fget_files+0x2a/0x420 [ 86.252776][ T5345] ? bpf_lsm_file_ioctl+0x9/0x20 [ 86.252791][ T5345] ? __pfx_sock_ioctl+0x10/0x10 [ 86.252802][ T5345] __se_sys_ioctl+0xfc/0x170 [ 86.252816][ T5345] do_syscall_64+0xec/0xf80 [ 86.252823][ T5345] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.252829][ T5345] ? trace_irq_disable+0x37/0x100 [ 86.252837][ T5345] ? clear_bhb_loop+0x60/0xb0 [ 86.252844][ T5345] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.252851][ T5345] RIP: 0033:0x7fcadc38f7c9 [ 86.252858][ T5345] 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.252874][ T5345] RSP: 002b:00007fcadd143038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 86.252883][ T5345] RAX: ffffffffffffffda RBX: 00007fcadc5e6090 RCX: 00007fcadc38f7c9 [ 86.252888][ T5345] RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000009 [ 86.252893][ T5345] RBP: 00007fcadc413f91 R08: 0000000000000000 R09: 0000000000000000 [ 86.252898][ T5345] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 86.252902][ T5345] R13: 00007fcadc5e6128 R14: 00007fcadc5e6090 R15: 00007ffe2e3db2b8 [ 86.252909][ T5345] [ 86.393557][ T5317] Bluetooth: hci0: command tx timeout [ 88.411492][ T5317] Bluetooth: hci0: command tx timeout [ 90.491500][ T5317] Bluetooth: hci0: command tx timeout [ 91.856320][ T9] cfg80211: failed to load regulatory.db