syzbot


WARNING: locking bug in kernfs_remove_by_name_ns

Status: upstream: reported on 2025/07/31 16:10
Subsystems: kernfs
[Documentation on labels]
Reported-by: syzbot+5ab23ab3166ecc1f994c@syzkaller.appspotmail.com
First crash: 28d, last: 2d07h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernfs?] WARNING: locking bug in kernfs_remove_by_name_ns 0 (1) 2025/07/31 16:10

Sample crash report:
comedi comedi3: c6xdigio: I/O port conflict (0xcf7,3)
------------[ cut here ]------------
DEBUG_LOCKS_WARN_ON(1)
WARNING: CPU: 0 PID: 16659 at kernel/locking/lockdep.c:238 hlock_class kernel/locking/lockdep.c:238 [inline]
WARNING: CPU: 0 PID: 16659 at kernel/locking/lockdep.c:238 hlock_class+0x64/0x70 kernel/locking/lockdep.c:227
Modules linked in:
CPU: 0 UID: 0 PID: 16659 Comm: syz.5.2644 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:hlock_class kernel/locking/lockdep.c:238 [inline]
RIP: 0010:hlock_class+0x64/0x70 kernel/locking/lockdep.c:227
Code: cc 90 e8 9f f0 48 03 85 c0 74 23 8b 05 05 21 14 0f 85 c0 75 19 90 48 c7 c6 ac aa e2 8d 48 c7 c7 6c 56 e1 8d e8 5d dd e2 ff 90 <0f> 0b 90 90 90 eb c9 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90
RSP: 0000:ffffc900036c7768 EFLAGS: 00010086
RAX: 0000000000000000 RBX: ffff888033f20af0 RCX: ffffc90020c91000
RDX: 0000000000080000 RSI: ffffffff817a3365 RDI: 0000000000000001
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 000000000004f650 R12: ffff888033f20b68
R13: ffff888033f20000 R14: 0000000000000000 R15: ffffffff8b503148
FS:  00007efc989196c0(0000) GS:ffff8881246bb000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000086030 CR3: 000000005b266000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 check_wait_context kernel/locking/lockdep.c:4854 [inline]
 __lock_acquire+0x218/0x1ce0 kernel/locking/lockdep.c:5187
 lock_acquire kernel/locking/lockdep.c:5868 [inline]
 lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825
 down_write+0x92/0x200 kernel/locking/rwsem.c:1590
 kernfs_remove_by_name_ns+0x3d/0x110 fs/kernfs/dir.c:1712
 sysfs_remove_file include/linux/sysfs.h:777 [inline]
 driver_remove_file drivers/base/driver.c:201 [inline]
 driver_remove_file+0x4a/0x60 drivers/base/driver.c:197
 remove_bind_files drivers/base/bus.c:605 [inline]
 bus_remove_driver+0x224/0x2c0 drivers/base/bus.c:743
 driver_unregister+0x76/0xb0 drivers/base/driver.c:277
 comedi_device_detach_locked+0x12c/0xa50 drivers/comedi/drivers.c:207
 comedi_device_detach+0x67/0xb0 drivers/comedi/drivers.c:215
 comedi_device_attach+0x43d/0x900 drivers/comedi/drivers.c:1010
 do_devconfig_ioctl+0x1b1/0x710 drivers/comedi/comedi_fops.c:872
 comedi_unlocked_ioctl+0x165d/0x2f00 drivers/comedi/comedi_fops.c:2173
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:598 [inline]
 __se_sys_ioctl fs/ioctl.c:584 [inline]
 __x64_sys_ioctl+0x18b/0x210 fs/ioctl.c:584
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7efc97b8ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007efc98919038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007efc97db5fa0 RCX: 00007efc97b8ebe9
RDX: 00002000000000c0 RSI: 0000000040946400 RDI: 0000000000000003
RBP: 00007efc97c11e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007efc97db6038 R14: 00007efc97db5fa0 R15: 00007ffdafcc4ea8
 </TASK>

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/22 23:12 upstream a2e94e80790b bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: locking bug in kernfs_remove_by_name_ns
2025/08/09 19:01 upstream 0227b49b5027 32a0e5ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: locking bug in kernfs_remove_by_name_ns
2025/08/04 01:14 upstream 038d61fd6422 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: locking bug in kernfs_remove_by_name_ns
2025/07/27 16:03 upstream ec2df4364666 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: locking bug in kernfs_remove_by_name_ns
2025/08/16 11:55 upstream d7ee5bdce789 1804e95e .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: locking bug in kernfs_remove_by_name_ns
2025/07/28 01:35 linux-next d086c886ceb9 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce WARNING: locking bug in kernfs_remove_by_name_ns
* Struck through repros no longer work on HEAD.