====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.5.156/5020 is trying to acquire lock: ffffffff8dd6c668 (serio_mutex){+.+.}-{3:3}, at: drvctl_store+0x2a/0xae0 drivers/input/serio/serio.c:388 but task is already holding lock: ffff888026a93748 (kn->active#690){++++}-{0:0}, at: kernfs_fop_write_iter+0x1fd/0x500 fs/kernfs/file.c:288 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (kn->active#690){++++}-{0:0} : kernfs_drain fs/kernfs/dir.c:478 [inline] __kernfs_remove+0x5da/0xcb0 fs/kernfs/dir.c:1372 kernfs_remove_by_name_ns+0x91/0x100 fs/kernfs/dir.c:1566 kernfs_remove_by_name include/linux/kernfs.h:598 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0xfd/0x290 fs/sysfs/group.c:289 sysfs_remove_groups+0x50/0xa0 fs/sysfs/group.c:313 device_remove_groups drivers/base/core.c:2500 [inline] device_remove_attrs+0xc2/0x140 drivers/base/core.c:2700 device_del+0x637/0xa80 drivers/base/core.c:3616 serio_destroy_port+0x34a/0x470 drivers/input/serio/serio.c:573 serio_unregister_port+0x12c/0x150 drivers/input/serio/serio.c:709 userio_char_release+0x7f/0xb0 drivers/input/serio/userio.c:111 __fput+0x212/0x8c0 fs/file_table.c:311 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217 __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (serio_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3125 [inline] check_prevs_add kernel/locking/lockdep.c:3244 [inline] validate_chain kernel/locking/lockdep.c:3860 [inline] __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_interruptible_nested+0x17/0x20 kernel/locking/mutex.c:765 drvctl_store+0x2a/0xae0 drivers/input/serio/serio.c:388 kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2181 [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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(kn->active#690 ); lock(serio_mutex); lock(kn->active #690); lock(serio_mutex); *** DEADLOCK *** 4 locks held by syz.5.156/5020: #0: ffff88802a0cf4f0 (&f->f_pos_lock){+.+.}-{3:3} , at: __fdget_pos+0x2bf/0x370 fs/file.c:1056 #1: ffff888064e36460 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x296/0xd70 fs/read_write.c:590 #2: ffff888061040088 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1dc/0x500 fs/kernfs/file.c:287 #3: ffff888026a93748 (kn->active#690 ){++++}-{0:0}, at: kernfs_fop_write_iter+0x1fd/0x500 fs/kernfs/file.c:288 stack backtrace: CPU: 1 PID: 5020 Comm: syz.5.156 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/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:3125 [inline] check_prevs_add kernel/locking/lockdep.c:3244 [inline] validate_chain kernel/locking/lockdep.c:3860 [inline] __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_interruptible_nested+0x17/0x20 kernel/locking/mutex.c:765 drvctl_store+0x2a/0xae0 drivers/input/serio/serio.c:388 kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2181 [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 RIP: 0033:0x7fd89450ca99 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:00007fd892738028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fd894799098 RCX: 00007fd89450ca99 RDX: 0000000000000003 RSI: 0000200000000280 RDI: 0000000000000004 RBP: 00007fd89459c18b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fd894799130 R14: 00007fd894799098 R15: 00007ffe5426a168 kernfs serio0: removing kernfs driver: removing kernfs extra: removing kernfs force_release: removing kernfs scroll: removing kernfs set: removing kernfs softrepeat: removing kernfs softraw: removing kernfs err_count: removing kobject: 'input2::numlock' (ffff888026b15000): kobject_uevent_env kobject: 'input2::numlock' (ffff888026b15000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input2/input2::numlock' device: 'input2::numlock': 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 input2::numlock: removing kernfs uevent: removing kernfs brightness: removing kernfs max_brightness: removing kernfs trigger: removing PM: Removing info for No Bus:input2::numlock kobject: 'input2::numlock' (ffff888026b15000): kobject_uevent_env kobject: 'input2::numlock' (ffff888026b15000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input2/input2::numlock' kernfs input2::numlock: removing kobject: 'input2::numlock' (ffff888026b15000): kobject_cleanup, parent 0000000000000000 kobject: 'input2::numlock' (ffff888026b15000): calling ktype release device: 'input2::numlock': device_create_release kobject: 'input2::numlock': free name kobject: 'input2::capslock' (ffff888026b16000): kobject_uevent_env kobject: 'input2::capslock' (ffff888026b16000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input2/input2::capslock' device: 'input2::capslock': 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 input2::capslock: removing kernfs uevent: removing kernfs brightness: removing kernfs max_brightness: removing kernfs trigger: removing PM: Removing info for No Bus:input2::capslock kobject: 'input2::capslock' (ffff888026b16000): kobject_uevent_env kobject: 'input2::capslock' (ffff888026b16000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input2/input2::capslock' kernfs input2::capslock: removing kobject: 'input2::capslock' (ffff888026b16000): kobject_cleanup, parent 0000000000000000 kobject: 'input2::capslock' (ffff888026b16000): calling ktype release device: 'input2::capslock': device_create_release kobject: 'input2::capslock': free name kobject: 'input2::scrolllock' (ffff888026b17000): kobject_uevent_env kobject: 'input2::scrolllock' (ffff888026b17000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input2/input2::scrolllock' device: 'input2::scrolllock': 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 input2::scrolllock: removing kernfs uevent: removing kernfs brightness: removing kernfs max_brightness: removing kernfs trigger: removing PM: Removing info for No Bus:input2::scrolllock kobject: 'input2::scrolllock' (ffff888026b17000): kobject_uevent_env kobject: 'input2::scrolllock' (ffff888026b17000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input2/input2::scrolllock' kernfs input2::scrolllock: removing kobject: 'input2::scrolllock' (ffff888026b17000): kobject_cleanup, parent 0000000000000000 kobject: 'input2::scrolllock' (ffff888026b17000): calling ktype release device: 'input2::scrolllock': device_create_release kobject: 'input2::scrolllock': free name 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 13:66: removing kernfs dev: removing kernfs device: removing kernfs subsystem: removing kernfs event2: removing kernfs uevent: removing PM: Removing info for No Bus:event2 kobject: 'event2' (ffff888026d28138): kobject_uevent_env kobject: 'event2' (ffff888026d28138): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input2/event2' kernfs event2: removing 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 input2: removing kernfs uevent: removing kernfs name: removing kernfs phys: removing kernfs uniq: removing kernfs modalias: removing kernfs properties: removing kernfs inhibited: removing kernfs bustype: removing kernfs vendor: removing kernfs product: removing kernfs version: removing kernfs id: removing kernfs ev: removing kernfs key: removing kernfs rel: removing kernfs abs: removing kernfs msc: removing kernfs led: removing kernfs snd: removing kernfs ff: removing kernfs sw: removing kernfs capabilities: removing PM: Removing info for No Bus:input2 kobject: 'input2' (ffff8881482522f0): kobject_uevent_env kobject: 'input2' (ffff8881482522f0): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input2' kernfs input2: removing kernfs input: removing kobject: 'input' (ffff8880268b3800): kobject_cleanup, parent 0000000000000000 kobject: 'input' (ffff8880268b3800): calling ktype release kobject: 'input': free name kobject: 'input2' (ffff8881482522f0): kobject_cleanup, parent 0000000000000000 kobject: 'input2' (ffff8881482522f0): calling ktype release kobject: 'input2': free name kobject: 'serio0' (ffff888026a3a200): kobject_uevent_env kobject: 'serio0' (ffff888026a3a200): fill_kobj_path: path = '/devices/platform/i8042/serio0' bus: 'serio': __driver_probe_device: matched device serio0 with driver atkbd bus: 'serio': really_probe: probing driver atkbd with device serio0 atkbd serio0: f2 - -5 (1), attempt 0 atkbd serio0: f2 [] - 1/00000000 [a5 a5] atkbd serio0: ed [00] - 0/00000000 [] atkbd serio0: ed [00] - 0/00000000 [] atkbd serio0: f3 [00] - 0/00000000 [] atkbd serio0: f4 [] - 0/00000000 [] device: 'input7': device_add kobject: 'input' (ffff88805f1d4a80): kobject_add_internal: parent: 'serio0', set: '(null)' kobject: 'input7' (ffff88807ca8a2f0): kobject_add_internal: parent: 'input', set: 'devices' input input7: No ACPI support PM: Adding info for No Bus:input7 kobject: 'input7' (ffff88807ca8a2f0): kobject_uevent_env kobject: 'input7' (ffff88807ca8a2f0): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input7' kobject: 'input7' (ffff88807ca8a2f0): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input7' input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input7 device: 'input7::numlock': device_add kobject: 'input7::numlock' (ffff88807ce91000): kobject_add_internal: parent: 'input7', set: 'devices' leds input7::numlock: No ACPI support PM: Adding info for No Bus:input7::numlock kobject: 'input7::numlock' (ffff88807ce91000): kobject_uevent_env kobject: 'input7::numlock' (ffff88807ce91000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input7/input7::numlock' kobject: 'input7::numlock' (ffff88807ce91000): kobject_uevent_env kobject: 'input7::numlock' (ffff88807ce91000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input7/input7::numlock' input input7: Registered led device: input7::numlock device: 'input7::capslock': device_add kobject: 'input7::capslock' (ffff88807ce97000): kobject_add_internal: parent: 'input7', set: 'devices' leds input7::capslock: No ACPI support PM: Adding info for No Bus:input7::capslock kobject: 'input7::capslock' (ffff88807ce97000): kobject_uevent_env kobject: 'input7::capslock' (ffff88807ce97000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input7/input7::capslock' kobject: 'input7::capslock' (ffff88807ce97000): kobject_uevent_env kobject: 'input7::capslock' (ffff88807ce97000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input7/input7::capslock' input input7: Registered led device: input7::capslock device: 'input7::scrolllock': device_add kobject: 'input7::scrolllock' (ffff88805f97e000): kobject_add_internal: parent: 'input7', set: 'devices' leds input7::scrolllock: No ACPI support PM: Adding info for No Bus:input7::scrolllock kobject: 'input7::scrolllock' (ffff88805f97e000): kobject_uevent_env kobject: 'input7::scrolllock' (ffff88805f97e000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input7/input7::scrolllock' kobject: 'input7::scrolllock' (ffff88805f97e000): kobject_uevent_env kobject: 'input7::scrolllock' (ffff88805f97e000): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input7/input7::scrolllock' input input7: Registered led device: input7::scrolllock device: 'event2': device_add kobject: 'event2' (ffff88805f97f138): kobject_add_internal: parent: 'input7', set: 'devices' input event2: No ACPI support PM: Adding info for No Bus:event2 kobject: 'event2' (ffff88805f97f138): kobject_uevent_env kobject: 'event2' (ffff88805f97f138): fill_kobj_path: path = '/devices/platform/i8042/serio0/input/input7/event2' driver: 'atkbd': driver_bound: bound to device 'serio0' kobject: 'serio0' (ffff888026a3a200): kobject_uevent_env kobject: 'serio0' (ffff888026a3a200): fill_kobj_path: path = '/devices/platform/i8042/serio0'