====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.6.141/5248 is trying to acquire lock: ffff888072829028 ((work_completion)(&hdev->bg_scan_update) ){+.+.}-{0:0}, at: __flush_work+0xfa/0x210 kernel/workqueue.c:3090 but task is already holding lock: ffffffff8e4d7308 (rfkill_global_mutex){+.+.}-{3:3} , at: rfkill_fop_write+0x1ae/0x560 net/rfkill/core.c:1279 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (rfkill_global_mutex){+.+.}-{3:3}: __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 rfkill_register+0x2f/0x970 net/rfkill/core.c:1060 hci_register_dev+0x459/0x980 net/bluetooth/hci_core.c:3987 __vhci_create_device drivers/bluetooth/hci_vhci.c:129 [inline] vhci_create_device+0x32e/0x5c0 drivers/bluetooth/hci_vhci.c:153 vhci_get_user drivers/bluetooth/hci_vhci.c:210 [inline] vhci_write+0x389/0x440 drivers/bluetooth/hci_vhci.c:290 call_write_iter include/linux/fs.h:2179 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #3 (&data->open_mutex ){+.+.}-{3:3} : __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 vhci_send_frame+0x88/0x100 drivers/bluetooth/hci_vhci.c:71 hci_send_frame+0x1a9/0x2e0 net/bluetooth/hci_core.c:4286 hci_sched_acl_pkt net/bluetooth/hci_core.c:4811 [inline] hci_sched_acl net/bluetooth/hci_core.c:4896 [inline] hci_tx_work+0x9b5/0x16d0 net/bluetooth/hci_core.c:4962 process_one_work+0x867/0xff0 kernel/workqueue.c:2310 worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 -> #2 ((work_completion)(&hdev->tx_work)){+.+.}-{0:0} : __flush_work+0x116/0x210 kernel/workqueue.c:3090 hci_dev_do_close+0x201/0x1020 net/bluetooth/hci_core.c:1774 hci_unregister_dev+0x2eb/0x590 net/bluetooth/hci_core.c:4070 vhci_release+0x73/0xc0 drivers/bluetooth/hci_vhci.c:345 __fput+0x212/0x8c0 fs/file_table.c:311 task_work_run+0x125/0x1a0 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0x635/0x2110 kernel/exit.c:890 do_group_exit+0x12c/0x2f0 kernel/exit.c:1004 __do_sys_exit_group kernel/exit.c:1015 [inline] __se_sys_exit_group kernel/exit.c:1013 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1013 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #1 ( &hdev->req_lock){+.+.}-{3:3} : __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 hci_req_sync net/bluetooth/hci_request.c:278 [inline] bg_scan_update+0x44/0x3b0 net/bluetooth/hci_request.c:2952 process_one_work+0x867/0xff0 kernel/workqueue.c:2310 worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 -> #0 ( (work_completion)(&hdev->bg_scan_update) ){+.+.}-{0:0} : check_prev_add kernel/locking/lockdep.c:3120 [inline] check_prevs_add kernel/locking/lockdep.c:3239 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737 __flush_work+0x116/0x210 kernel/workqueue.c:3090 __cancel_work_timer+0x3f4/0x560 kernel/workqueue.c:3181 hci_request_cancel_all+0xcc/0x300 net/bluetooth/hci_request.c:3522 hci_dev_do_close+0x4e/0x1020 net/bluetooth/hci_core.c:1754 hci_rfkill_set_block+0x101/0x180 net/bluetooth/hci_core.c:2253 rfkill_set_block+0x1c1/0x3c0 net/rfkill/core.c:360 rfkill_fop_write+0x453/0x560 net/rfkill/core.c:1287 vfs_write+0x304/0xd70 fs/read_write.c:592 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: (work_completion)(&hdev->bg_scan_update) --> &data->open_mutex --> rfkill_global_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock( rfkill_global_mutex ); lock( &data->open_mutex); lock(rfkill_global_mutex); lock((work_completion)(&hdev->bg_scan_update)); *** DEADLOCK *** 1 lock held by syz.6.141/5248: #0: ffffffff8e4d7308 (rfkill_global_mutex ){+.+.}-{3:3}, at: rfkill_fop_write+0x1ae/0x560 net/rfkill/core.c:1279 stack backtrace: CPU: 1 PID: 5248 Comm: syz.6.141 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3120 [inline] check_prevs_add kernel/locking/lockdep.c:3239 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737 __flush_work+0x116/0x210 kernel/workqueue.c:3090 __cancel_work_timer+0x3f4/0x560 kernel/workqueue.c:3181 hci_request_cancel_all+0xcc/0x300 net/bluetooth/hci_request.c:3522 hci_dev_do_close+0x4e/0x1020 net/bluetooth/hci_core.c:1754 hci_rfkill_set_block+0x101/0x180 net/bluetooth/hci_core.c:2253 rfkill_set_block+0x1c1/0x3c0 net/rfkill/core.c:360 rfkill_fop_write+0x453/0x560 net/rfkill/core.c:1287 vfs_write+0x304/0xd70 fs/read_write.c:592 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f7bef9f01d9 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 RSP: 002b:00007f7bedc48028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f7befc77fa0 RCX: 00007f7bef9f01d9 RDX: 0000000000000008 RSI: 0000200000000980 RDI: 0000000000000003 RBP: 00007f7befa87888 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f7befc78038 R14: 00007f7befc77fa0 R15: 00007ffc424f3b48 hci4: cancelling interleave scan hci4 state 0 -> 0 All LE pending actions cleared hdev hci4 hcon ffff888062488000 reason 22 hcon ffff888062488000 conn ffff888062482800, err 103 hci4 hcon ffff888062488000 chan ffff888026617400 hci4 hcon ffff888062488000 handle 201 hcon ffff888062488000 hci4: conn ffff888062488000 device: 'hci4:201': device_unregister kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs device: removing kernfs subsystem: removing kernfs hci4:201: removing kernfs uevent: removing PM: Removing info for No Bus:hci4:201 kobject: 'hci4:201' (ffff888062488420): kobject_uevent_env kobject: 'hci4:201' (ffff888062488420): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/hci4:201' kernfs hci4:201: removing kobject: 'hci4:201' (ffff888062488420): kobject_cleanup, parent 0000000000000000 kobject: 'hci4:201' (ffff888062488420): calling ktype release kobject: 'hci4:201': free name hci4 orig refcnt 10 hcon ffff888074f54000 reason 22 hcon ffff888074f54000 conn ffff888062482000, err 103 hci4 hcon ffff888074f54000 chan ffff888026617200 hci4 hcon ffff888074f54000 handle 200 hcon ffff888074f54000 hci4: conn ffff888074f54000 device: 'hci4:200': device_unregister kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs device: removing kernfs subsystem: removing kernfs hci4:200: removing kernfs uevent: removing PM: Removing info for No Bus:hci4:200 kobject: 'hci4:200' (ffff888074f54420): kobject_uevent_env kobject: 'hci4:200' (ffff888074f54420): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/hci4:200' kernfs hci4:200: removing kobject: 'hci4:200' (ffff888074f54420): kobject_cleanup, parent 0000000000000000 kobject: 'hci4:200' (ffff888074f54420): calling ktype release kobject: 'hci4:200': free name hci4 orig refcnt 7 hdev hci4 event 4 hdev 0000000000000000 len 8 hdev hci4 event 8 hci4 orig refcnt 6 kobject: 'rfkill9' (ffff88814c95a108): kobject_uevent_env kobject: 'rfkill9' (ffff88814c95a108): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill9' ffff88805c280000 name hci3 blocked 1 hci3 ffff88805c280000 hci3: err 0x13 hci3: cancelling interleave scan hci3 state 0 -> 0 All LE pending actions cleared hdev hci3 hcon ffff88802cebe000 reason 22 hcon ffff88802cebe000 conn ffff88802bb5c000, err 103 hci3 hcon ffff88802cebe000 chan ffff88805a1aaa00 hci3 hcon ffff88802cebe000 handle 201 hcon ffff88802cebe000 hci3: conn ffff88802cebe000 device: 'hci3:201': device_unregister kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs device: removing kernfs subsystem: removing kernfs hci3:201: removing kernfs uevent: removing PM: Removing info for No Bus:hci3:201 kobject: 'hci3:201' (ffff88802cebe420): kobject_uevent_env kobject: 'hci3:201' (ffff88802cebe420): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/hci3:201' kernfs hci3:201: removing kobject: 'hci3:201' (ffff88802cebe420): kobject_cleanup, parent 0000000000000000 kobject: 'hci3:201' (ffff88802cebe420): calling ktype release kobject: 'hci3:201': free name hci3 orig refcnt 10 hcon ffff88802c408000 reason 22 hcon ffff88802c408000 conn ffff88802bb5c800, err 103 hci3 hcon ffff88802c408000 chan ffff88805a1aa900 hci3 hcon ffff88802c408000 handle 200 hcon ffff88802c408000 hci3: conn ffff88802c408000 device: 'hci3:200': device_unregister kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs device: removing kernfs subsystem: removing kernfs hci3:200: removing kernfs uevent: removing PM: Removing info for No Bus:hci3:200 kobject: 'hci3:200' (ffff88802c408420): kobject_uevent_env kobject: 'hci3:200' (ffff88802c408420): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/hci3:200' kernfs hci3:200: removing kobject: 'hci3:200' (ffff88802c408420): kobject_cleanup, parent 0000000000000000 kobject: 'hci3:200' (ffff88802c408420): calling ktype release kobject: 'hci3:200': free name hci3 orig refcnt 7 hdev hci3 event 4 hdev 0000000000000000 len 8 hdev hci3 event 8 hci3 orig refcnt 6 kobject: 'rfkill20' (ffff888020045108): kobject_uevent_env kobject: 'rfkill20' (ffff888020045108): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill20' ffff888066adc000 name hci2 blocked 1 hci2 ffff888066adc000 hci2: err 0x13 hci2: cancelling interleave scan hci2 state 0 -> 0 All LE pending actions cleared hdev hci2 hcon ffff888079d98000 reason 22 hcon ffff888079d98000 conn ffff88801e739000, err 103 hci2 hcon ffff888079d98000 chan ffff8880752f6c00 hci2 hcon ffff888079d98000 handle 201 hcon ffff888079d98000 hci2: conn ffff888079d98000 device: 'hci2:201': device_unregister kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs device: removing kernfs subsystem: removing kernfs hci2:201: removing kernfs uevent: removing PM: Removing info for No Bus:hci2:201 kobject: 'hci2:201' (ffff888079d98420): kobject_uevent_env kobject: 'hci2:201' (ffff888079d98420): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2/hci2:201' kernfs hci2:201: removing kobject: 'hci2:201' (ffff888079d98420): kobject_cleanup, parent 0000000000000000 kobject: 'hci2:201' (ffff888079d98420): calling ktype release kobject: 'hci2:201': free name hci2 orig refcnt 10 hcon ffff888079796000 reason 22 hcon ffff888079796000 conn ffff88801e739800, err 103 hci2 hcon ffff888079796000 chan ffff8880752f6800 hci2 hcon ffff888079796000 handle 200 hcon ffff888079796000 hci2: conn ffff888079796000 device: 'hci2:200': device_unregister kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs device: removing kernfs subsystem: removing kernfs hci2:200: removing kernfs uevent: removing PM: Removing info for No Bus:hci2:200 kobject: 'hci2:200' (ffff888079796420): kobject_uevent_env kobject: 'hci2:200' (ffff888079796420): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2/hci2:200' kernfs hci2:200: removing kobject: 'hci2:200' (ffff888079796420): kobject_cleanup, parent 0000000000000000 kobject: 'hci2:200' (ffff888079796420): calling ktype release kobject: 'hci2:200': free name hci2 orig refcnt 7 hdev hci2 event 4 hdev 0000000000000000 len 8 hdev hci2 event 8 hci2 orig refcnt 6 kobject: 'rfkill21' (ffff888020ad8108): kobject_uevent_env kobject: 'rfkill21' (ffff888020ad8108): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2/rfkill21' ffff888029920000 name hci0 blocked 1 hci0 ffff888029920000 hci0: err 0x13 hci0: cancelling interleave scan