program: r0 = openat$rfkill(0xffffffffffffff9c, &(0x7f0000000040), 0x801, 0x0) write$rfkill(r0, &(0x7f0000000080)={0xfeffffff, 0x0, 0x3, 0x1}, 0x8) [ 84.026440][ T45] Bluetooth: hci0: command tx timeout [ 85.117217][ T5321] Bluetooth: hci0: Opcode 0x0c1a failed: -4 [ 85.120083][ T5321] Bluetooth: hci0: Error when powering off device on rfkill (-4) [ 85.149094][ T5321] [ 85.150349][ T5321] ====================================================== [ 85.153784][ T5321] WARNING: possible circular locking dependency detected [ 85.156902][ T5321] syzkaller #0 Not tainted [ 85.158982][ T5321] ------------------------------------------------------ [ 85.162210][ T5321] syz.0.0/5321 is trying to acquire lock: [ 85.164773][ T5321] ffff8880123f2840 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0x100/0xc50 [ 85.170141][ T5321] [ 85.170141][ T5321] but task is already holding lock: [ 85.173471][ T5321] ffff8880123f2af8 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5c0 [ 85.177367][ T5321] [ 85.177367][ T5321] which lock already depends on the new lock. [ 85.177367][ T5321] [ 85.181766][ T5321] [ 85.181766][ T5321] the existing dependency chain (in reverse order) is: [ 85.185565][ T5321] [ 85.185565][ T5321] -> #1 (&conn->lock#2){+.+.}-{4:4}: [ 85.188793][ T5321] __mutex_lock+0x19f/0x1300 [ 85.190939][ T5321] l2cap_info_timeout+0x60/0xa0 [ 85.193391][ T5321] process_scheduled_works+0xb6e/0x18c0 [ 85.196396][ T5321] worker_thread+0xa53/0xfc0 [ 85.198662][ T5321] kthread+0x388/0x470 [ 85.200715][ T5321] ret_from_fork+0x51e/0xb90 [ 85.203030][ T5321] ret_from_fork_asm+0x1a/0x30 [ 85.206492][ T5321] [ 85.206492][ T5321] -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: [ 85.211978][ T5321] __lock_acquire+0x15a5/0x2cf0 [ 85.214725][ T5321] lock_acquire+0xf0/0x2e0 [ 85.216845][ T5321] __flush_work+0x700/0xc50 [ 85.219044][ T5321] __cancel_work_sync+0xbe/0x110 [ 85.222144][ T5321] l2cap_conn_del+0x40f/0x5c0 [ 85.224888][ T5321] hci_conn_hash_flush+0x10d/0x260 [ 85.227473][ T5321] hci_dev_close_sync+0x821/0x10e0 [ 85.230170][ T5321] hci_dev_do_close+0x30/0xc0 [ 85.233461][ T5321] hci_rfkill_set_block+0x1f4/0x290 [ 85.236437][ T5321] rfkill_set_block+0x1d2/0x440 [ 85.238697][ T5321] rfkill_fop_write+0x461/0x5a0 [ 85.241025][ T5321] vfs_write+0x29a/0xb90 [ 85.243201][ T5321] ksys_write+0x150/0x270 [ 85.245465][ T5321] do_syscall_64+0x14d/0xf80 [ 85.248008][ T5321] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 85.251652][ T5321] [ 85.251652][ T5321] other info that might help us debug this: [ 85.251652][ T5321] [ 85.256253][ T5321] Possible unsafe locking scenario: [ 85.256253][ T5321] [ 85.259345][ T5321] CPU0 CPU1 [ 85.261580][ T5321] ---- ---- [ 85.263758][ T5321] lock(&conn->lock#2); [ 85.265823][ T5321] lock((work_completion)(&(&conn->info_timer)->work)); [ 85.271045][ T5321] lock(&conn->lock#2); [ 85.274042][ T5321] lock((work_completion)(&(&conn->info_timer)->work)); [ 85.276838][ T5321] [ 85.276838][ T5321] *** DEADLOCK *** [ 85.276838][ T5321] [ 85.280437][ T5321] 6 locks held by syz.0.0/5321: [ 85.282802][ T5321] #0: ffffffff8feea628 (rfkill_global_mutex){+.+.}-{4:4}, at: rfkill_fop_write+0x19a/0x5a0 [ 85.286887][ T5321] #1: ffff88801f8ccec0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_do_close+0x28/0xc0 [ 85.290809][ T5321] #2: ffff88801f8cc0c0 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x640/0x10e0 [ 85.294925][ T5321] #3: ffffffff8fd5dee8 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x260 [ 85.299720][ T5321] #4: ffff8880123f2af8 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5c0 [ 85.303817][ T5321] #5: ffffffff8e75e5e0 (rcu_read_lock){....}-{1:3}, at: __flush_work+0x100/0xc50 [ 85.307878][ T5321] [ 85.307878][ T5321] stack backtrace: [ 85.310503][ T5321] CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 85.310525][ T5321] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 85.310559][ T5321] Call Trace: [ 85.310568][ T5321] [ 85.310576][ T5321] dump_stack_lvl+0xe8/0x150 [ 85.310598][ T5321] print_circular_bug+0x2e1/0x300 [ 85.310620][ T5321] check_noncircular+0x12e/0x150 [ 85.310637][ T5321] __lock_acquire+0x15a5/0x2cf0 [ 85.310651][ T5321] ? irqentry_exit+0x59e/0x620 [ 85.310662][ T5321] ? lockdep_hardirqs_on+0x7a/0x110 [ 85.310672][ T5321] ? irqentry_exit+0x59e/0x620 [ 85.310683][ T5321] ? trace_irq_disable+0x3b/0x150 [ 85.310695][ T5321] lock_acquire+0xf0/0x2e0 [ 85.310709][ T5321] ? __flush_work+0x100/0xc50 [ 85.310727][ T5321] ? __flush_work+0x100/0xc50 [ 85.310747][ T5321] __flush_work+0x700/0xc50 [ 85.310761][ T5321] ? __flush_work+0x100/0xc50 [ 85.310774][ T5321] ? __flush_work+0x100/0xc50 [ 85.310792][ T5321] ? __pfx___flush_work+0x10/0x10 [ 85.310809][ T5321] ? __pfx_wq_barrier_func+0x10/0x10 [ 85.310827][ T5321] ? __cancel_work_sync+0x5c/0x110 [ 85.310843][ T5321] __cancel_work_sync+0xbe/0x110 [ 85.310858][ T5321] l2cap_conn_del+0x40f/0x5c0 [ 85.310874][ T5321] ? __pfx_l2cap_disconn_cfm+0x10/0x10 [ 85.310889][ T5321] hci_conn_hash_flush+0x10d/0x260 [ 85.310905][ T5321] hci_dev_close_sync+0x821/0x10e0 [ 85.310921][ T5321] ? __pfx_hci_dev_close_sync+0x10/0x10 [ 85.310934][ T5321] ? do_raw_spin_lock+0x12b/0x2f0 [ 85.310945][ T5321] hci_dev_do_close+0x30/0xc0 [ 85.310960][ T5321] hci_rfkill_set_block+0x1f4/0x290 [ 85.310973][ T5321] ? __pfx_hci_rfkill_set_block+0x10/0x10 [ 85.310985][ T5321] rfkill_set_block+0x1d2/0x440 [ 85.311002][ T5321] rfkill_fop_write+0x461/0x5a0 [ 85.311013][ T5321] ? apparmor_file_permission+0x1f4/0x300 [ 85.311099][ T5321] ? __pfx_rfkill_fop_write+0x10/0x10 [ 85.311111][ T5321] ? security_file_permission+0x60/0x260 [ 85.311123][ T5321] ? rw_verify_area+0x255/0x4d0 [ 85.311141][ T5321] ? __pfx_rfkill_fop_write+0x10/0x10 [ 85.311151][ T5321] vfs_write+0x29a/0xb90 [ 85.311169][ T5321] ? __pfx_vfs_write+0x10/0x10 [ 85.311184][ T5321] ? __fget_files+0x2a/0x420 [ 85.311197][ T5321] ? __fget_files+0x2a/0x420 [ 85.311209][ T5321] ? __fget_files+0x3a0/0x420 [ 85.311222][ T5321] ? __fget_files+0x2a/0x420 [ 85.311235][ T5321] ksys_write+0x150/0x270 [ 85.311253][ T5321] ? __pfx_ksys_write+0x10/0x10 [ 85.311269][ T5321] do_syscall_64+0x14d/0xf80 [ 85.311289][ T5321] ? trace_irq_disable+0x3b/0x150 [ 85.311300][ T5321] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 85.311311][ T5321] ? clear_bhb_loop+0x40/0x90 [ 85.311325][ T5321] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 85.311339][ T5321] RIP: 0033:0x7f2d1919c799 [ 85.311353][ T5321] 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 [ 85.311369][ T5321] RSP: 002b:00007f2d1a0c4fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 85.311389][ T5321] RAX: ffffffffffffffda RBX: 00007f2d19415fa0 RCX: 00007f2d1919c799 [ 85.311397][ T5321] RDX: 0000000000000008 RSI: 0000200000000080 RDI: 0000000000000003 [ 85.311405][ T5321] RBP: 00007f2d19232c99 R08: 0000000000000000 R09: 0000000000000000 [ 85.311412][ T5321] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 85.311419][ T5321] R13: 00007f2d19416038 R14: 00007f2d19415fa0 R15: 00007ffd670a5458 [ 85.311432][ T5321] [ 86.084764][ T45] Bluetooth: hci0: command tx timeout [ 88.165328][ T45] Bluetooth: hci0: command tx timeout [ 90.244473][ T45] Bluetooth: hci0: command tx timeout