====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.6.458/6025 is trying to acquire lock: ffffffff8cf51308 (serio_mutex){+.+.}-{3:3}, at: drvctl_store+0x2a/0xae0 drivers/input/serio/serio.c:388 but task is already holding lock: ffff88801f0de0f0 (kn->active#513){++++}-{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#513){++++}-{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:2498 [inline] device_remove_attrs+0xc2/0x140 drivers/base/core.c:2698 device_del+0x637/0xa80 drivers/base/core.c:3614 serio_destroy_port+0x34a/0x470 drivers/input/serio/serio.c:573 serio_unregister_port+0x12c/0x150 drivers/input/serio/serio.c:709 serport_ldisc_read+0x4ec/0x5b0 drivers/input/serio/serport.c:188 iterate_tty_read drivers/tty/tty_io.c:868 [inline] tty_read+0x2af/0x5c0 drivers/tty/tty_io.c:944 call_read_iter include/linux/fs.h:2173 [inline] aio_read+0x33a/0x490 fs/aio.c:1554 __io_submit_one fs/aio.c:-1 [inline] io_submit_one+0x68b/0x1310 fs/aio.c:2013 __do_sys_io_submit fs/aio.c:2072 [inline] __se_sys_io_submit+0x19d/0x310 fs/aio.c:2042 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 -> #0 (serio_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 __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: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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(kn->active#513); lock(serio_mutex); lock(kn->active#513); lock(serio_mutex); *** DEADLOCK *** 4 locks held by syz.6.458/6025: #0: ffff888022841c70 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2bf/0x370 fs/file.c:1056 #1: ffff888022eba460 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x296/0xd70 fs/read_write.c:590 #2: ffff88805f233088 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1dc/0x500 fs/kernfs/file.c:287 #3: ffff88801f0de0f0 (kn->active#513){++++}-{0:0}, at: kernfs_fop_write_iter+0x1fd/0x500 fs/kernfs/file.c:288 stack backtrace: CPU: 0 PID: 6025 Comm: syz.6.458 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 __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: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 RIP: 0033:0x7fd0c8321159 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:00007fd0c6579028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fd0c85a8fa0 RCX: 00007fd0c8321159 RDX: 0000000000000005 RSI: 0000200000000200 RDI: 0000000000000004 RBP: 00007fd0c83b8024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fd0c85a9038 R14: 00007fd0c85a8fa0 R15: 00007fff266d7988 input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input5