program: r0 = openat$rfkill(0xffffffffffffff9c, &(0x7f0000000040), 0x801, 0x0) write$rfkill(r0, &(0x7f0000000080)={0x0, 0x0, 0x3, 0x1}, 0x8) r1 = syz_init_net_socket$nl_generic(0x10, 0x3, 0x10) r2 = syz_genetlink_get_family_id$nfc(&(0x7f0000000100), r1) sendmsg$NFC_CMD_DEV_UP(r1, &(0x7f0000000140)={0x0, 0x0, &(0x7f0000000180)={&(0x7f00000001c0)={0x1c, r2, 0x1, 0x0, 0x0, {}, [@NFC_ATTR_DEVICE_INDEX={0x8}]}, 0x1c}}, 0x0) [ 83.956316][ T5302] Bluetooth: hci0: command tx timeout [ 85.062079][ T5322] Bluetooth: hci0: Opcode 0x0c1a failed: -4 [ 85.065062][ T5322] Bluetooth: hci0: Error when powering off device on rfkill (-4) [ 85.114296][ T5322] [ 85.115842][ T5322] ====================================================== [ 85.119373][ T5322] WARNING: possible circular locking dependency detected [ 85.122658][ T5322] syzkaller #0 Not tainted [ 85.124757][ T5322] ------------------------------------------------------ [ 85.128402][ T5322] syz.0.0/5322 is trying to acquire lock: [ 85.131645][ T5322] ffff888038c2a040 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}, at: __flush_work+0x100/0xc50 [ 85.137465][ T5322] [ 85.137465][ T5322] but task is already holding lock: [ 85.140773][ T5322] ffff888038c2a2f8 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5c0 [ 85.144968][ T5322] [ 85.144968][ T5322] which lock already depends on the new lock. [ 85.144968][ T5322] [ 85.150983][ T5322] [ 85.150983][ T5322] the existing dependency chain (in reverse order) is: [ 85.155881][ T5322] [ 85.155881][ T5322] -> #1 (&conn->lock#2){+.+.}-{4:4}: [ 85.159281][ T5322] __mutex_lock+0x19f/0x1300 [ 85.161742][ T5322] l2cap_info_timeout+0x60/0xa0 [ 85.164399][ T5322] process_scheduled_works+0xb02/0x1830 [ 85.167277][ T5322] worker_thread+0xa50/0xfc0 [ 85.169834][ T5322] kthread+0x388/0x470 [ 85.172717][ T5322] ret_from_fork+0x51e/0xb90 [ 85.175464][ T5322] ret_from_fork_asm+0x1a/0x30 [ 85.177800][ T5322] [ 85.177800][ T5322] -> #0 ((work_completion)(&(&conn->info_timer)->work)){+.+.}-{0:0}: [ 85.182538][ T5322] __lock_acquire+0x15a5/0x2cf0 [ 85.185243][ T5322] lock_acquire+0xf0/0x2e0 [ 85.187964][ T5322] __flush_work+0x700/0xc50 [ 85.190514][ T5322] __cancel_work_sync+0xbe/0x110 [ 85.193085][ T5322] l2cap_conn_del+0x40f/0x5c0 [ 85.195577][ T5322] hci_conn_hash_flush+0x10d/0x260 [ 85.198347][ T5322] hci_dev_close_sync+0x821/0x10e0 [ 85.202256][ T5322] hci_dev_do_close+0x30/0xc0 [ 85.205012][ T5322] hci_rfkill_set_block+0x1f4/0x290 [ 85.207754][ T5322] rfkill_set_block+0x1d2/0x440 [ 85.210252][ T5322] rfkill_fop_write+0x461/0x5a0 [ 85.212844][ T5322] vfs_write+0x29a/0xb90 [ 85.215960][ T5322] ksys_write+0x150/0x270 [ 85.219276][ T5322] do_syscall_64+0x14d/0xf80 [ 85.221854][ T5322] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 85.224835][ T5322] [ 85.224835][ T5322] other info that might help us debug this: [ 85.224835][ T5322] [ 85.229000][ T5322] Possible unsafe locking scenario: [ 85.229000][ T5322] [ 85.232097][ T5322] CPU0 CPU1 [ 85.234816][ T5322] ---- ---- [ 85.238690][ T5322] lock(&conn->lock#2); [ 85.240916][ T5322] lock((work_completion)(&(&conn->info_timer)->work)); [ 85.245173][ T5322] lock(&conn->lock#2); [ 85.248392][ T5322] lock((work_completion)(&(&conn->info_timer)->work)); [ 85.251638][ T5322] [ 85.251638][ T5322] *** DEADLOCK *** [ 85.251638][ T5322] [ 85.256204][ T5322] 6 locks held by syz.0.0/5322: [ 85.259114][ T5322] #0: ffffffff8fee7f68 (rfkill_global_mutex){+.+.}-{4:4}, at: rfkill_fop_write+0x19a/0x5a0 [ 85.263619][ T5322] #1: ffff8880426c8ec0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_do_close+0x28/0xc0 [ 85.267951][ T5322] #2: ffff8880426c80c0 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x640/0x10e0 [ 85.273688][ T5322] #3: ffffffff8fd5baa8 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x260 [ 85.278682][ T5322] #4: ffff888038c2a2f8 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x7b/0x5c0 [ 85.282972][ T5322] #5: ffffffff8e75e420 (rcu_read_lock){....}-{1:3}, at: __flush_work+0x100/0xc50 [ 85.287021][ T5322] [ 85.287021][ T5322] stack backtrace: [ 85.289965][ T5322] CPU: 0 UID: 0 PID: 5322 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 85.289985][ T5322] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 85.289993][ T5322] Call Trace: [ 85.290004][ T5322] [ 85.290053][ T5322] dump_stack_lvl+0xe8/0x150 [ 85.290080][ T5322] print_circular_bug+0x2e1/0x300 [ 85.290100][ T5322] check_noncircular+0x12e/0x150 [ 85.290117][ T5322] __lock_acquire+0x15a5/0x2cf0 [ 85.290132][ T5322] ? do_raw_spin_lock+0x12b/0x2f0 [ 85.290177][ T5322] ? do_raw_spin_unlock+0x4d/0x210 [ 85.290187][ T5322] lock_acquire+0xf0/0x2e0 [ 85.290196][ T5322] ? __flush_work+0x100/0xc50 [ 85.290214][ T5322] ? __flush_work+0x100/0xc50 [ 85.290231][ T5322] __flush_work+0x700/0xc50 [ 85.290247][ T5322] ? __flush_work+0x100/0xc50 [ 85.290265][ T5322] ? __flush_work+0x100/0xc50 [ 85.290284][ T5322] ? __pfx___flush_work+0x10/0x10 [ 85.290299][ T5322] ? __pfx_wq_barrier_func+0x10/0x10 [ 85.290316][ T5322] ? __cancel_work_sync+0x5c/0x110 [ 85.290331][ T5322] __cancel_work_sync+0xbe/0x110 [ 85.290344][ T5322] l2cap_conn_del+0x40f/0x5c0 [ 85.290361][ T5322] ? __pfx_l2cap_disconn_cfm+0x10/0x10 [ 85.290372][ T5322] hci_conn_hash_flush+0x10d/0x260 [ 85.290389][ T5322] hci_dev_close_sync+0x821/0x10e0 [ 85.290403][ T5322] ? __pfx_hci_dev_close_sync+0x10/0x10 [ 85.290414][ T5322] ? do_raw_spin_lock+0x12b/0x2f0 [ 85.290425][ T5322] hci_dev_do_close+0x30/0xc0 [ 85.290439][ T5322] hci_rfkill_set_block+0x1f4/0x290 [ 85.290450][ T5322] ? __pfx_hci_rfkill_set_block+0x10/0x10 [ 85.290461][ T5322] rfkill_set_block+0x1d2/0x440 [ 85.290479][ T5322] rfkill_fop_write+0x461/0x5a0 [ 85.290493][ T5322] ? apparmor_file_permission+0x1f4/0x300 [ 85.290561][ T5322] ? __pfx_rfkill_fop_write+0x10/0x10 [ 85.290576][ T5322] ? security_kernfs_init_security+0x200/0x270 [ 85.290593][ T5322] ? rw_verify_area+0x255/0x4d0 [ 85.290609][ T5322] ? __pfx_rfkill_fop_write+0x10/0x10 [ 85.290624][ T5322] vfs_write+0x29a/0xb90 [ 85.290639][ T5322] ? __pfx_vfs_write+0x10/0x10 [ 85.290656][ T5322] ? __fget_files+0x2a/0x420 [ 85.290679][ T5322] ? __fget_files+0x2a/0x420 [ 85.290694][ T5322] ? __fget_files+0x3a0/0x420 [ 85.290710][ T5322] ? __fget_files+0x2a/0x420 [ 85.290724][ T5322] ksys_write+0x150/0x270 [ 85.290740][ T5322] ? __pfx_ksys_write+0x10/0x10 [ 85.290758][ T5322] do_syscall_64+0x14d/0xf80 [ 85.290775][ T5322] ? trace_irq_disable+0x3b/0x150 [ 85.290789][ T5322] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 85.290801][ T5322] ? clear_bhb_loop+0x40/0x90 [ 85.290814][ T5322] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 85.290825][ T5322] RIP: 0033:0x7f2a8019c799 [ 85.290839][ T5322] 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.290848][ T5322] RSP: 002b:00007f2a81072fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 85.290863][ T5322] RAX: ffffffffffffffda RBX: 00007f2a80415fa0 RCX: 00007f2a8019c799 [ 85.290872][ T5322] RDX: 0000000000000008 RSI: 0000200000000080 RDI: 0000000000000003 [ 85.290883][ T5322] RBP: 00007f2a80232c99 R08: 0000000000000000 R09: 0000000000000000 [ 85.290891][ T5322] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 85.290898][ T5322] R13: 00007f2a80416038 R14: 00007f2a80415fa0 R15: 00007fffbb3329e8 [ 85.290910][ T5322] [ 85.984111][ T5302] Bluetooth: hci0: command tx timeout [ 88.062418][ T5302] Bluetooth: hci0: command tx timeout [ 90.142051][ T5302] Bluetooth: hci0: command tx timeout