[syzbot] WARNING in __kernfs_remove

From: syzbot
Date: Sun Sep 11 2022 - 06:20:37 EST


Hello,

syzbot found the following issue on:

HEAD commit: 25050c56fa3c Merge branch 'for-next/fixes' into for-kernelci
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=1572d025080000
kernel config: https://syzkaller.appspot.com/x/.config?x=db8b30b83a444315
dashboard link: https://syzkaller.appspot.com/bug?extid=9526e2e1fc98a6452cd5
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=176b3417080000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11c53007080000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+9526e2e1fc98a6452cd5@xxxxxxxxxxxxxxxxxxxxxxxxx

------------[ cut here ]------------
WARNING: CPU: 0 PID: 3237 at fs/kernfs/dir.c:504 kernfs_get fs/kernfs/dir.c:504 [inline]
WARNING: CPU: 0 PID: 3237 at fs/kernfs/dir.c:504 __kernfs_remove+0x6e4/0x7b8 fs/kernfs/dir.c:1377
Modules linked in:
CPU: 0 PID: 3237 Comm: syz-executor100 Not tainted 6.0.0-rc4-syzkaller-17186-g25050c56fa3c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : kernfs_get fs/kernfs/dir.c:504 [inline]
pc : __kernfs_remove+0x6e4/0x7b8 fs/kernfs/dir.c:1377
lr : kernfs_get fs/kernfs/dir.c:504 [inline]
lr : __kernfs_remove+0x6e4/0x7b8 fs/kernfs/dir.c:1377
sp : ffff8000129138a0
x29: ffff8000129138d0 x28: ffff80000cf35761 x27: 0000000080000001
x26: ffff0000c0011800 x25: ffff80000d37c000 x24: ffff0000cd23c2a0
x23: ffff0000cd23cc10 x22: 0000000000000000 x21: ffff0000cd23c2a0
x20: ffff0000cd23c2a0 x19: ffff800008702970 x18: 0000000000000300
x17: ffff80000c04d6bc x16: ffff80000dbb8658 x15: ffff0000cb12b500
x14: 0000000000000000 x13: 00000000ffffffff x12: ffff0000cb12b500
x11: ff80800008702360 x10: 0000000000000000 x9 : ffff800008702360
x8 : ffff0000cb12b500 x7 : ffff8000095ef734 x6 : 0000000000000000
x5 : 0000000080180000 x4 : fffffc0003348f20 x3 : 0000000080180000
x2 : ffff0000cd23c2a0 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
kernfs_get fs/kernfs/dir.c:504 [inline]
__kernfs_remove+0x6e4/0x7b8 fs/kernfs/dir.c:1377
kernfs_remove_by_name_ns+0x68/0xb8 fs/kernfs/dir.c:1589
kernfs_remove_by_name include/linux/kernfs.h:615 [inline]
sysfs_remove_link+0x40/0x50 fs/sysfs/symlink.c:152
sysfs_slab_add+0x70/0x260 mm/slub.c:5943
__kmem_cache_create+0x60/0x118 mm/slub.c:4899
create_cache mm/slab_common.c:229 [inline]
kmem_cache_create_usercopy+0x19c/0x31c mm/slab_common.c:335
p9_client_create+0x618/0x758 net/9p/client.c:993
v9fs_session_init+0xa4/0x9f0 fs/9p/v9fs.c:408
v9fs_mount+0x6c/0x548 fs/9p/vfs_super.c:126
legacy_get_tree+0x30/0x74 fs/fs_context.c:610
vfs_get_tree+0x40/0x140 fs/super.c:1530
do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040
path_mount+0x358/0x914 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__arm64_sys_mount+0x2f8/0x408 fs/namespace.c:3568
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall arch/arm64/kernel/syscall.c:52 [inline]
el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x48/0x154 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:624
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:642
el0t_64_sync+0x18c/0x190
irq event stamp: 1110
hardirqs last enabled at (1109): [<ffff80000c0121cc>] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline]
hardirqs last enabled at (1109): [<ffff80000c0121cc>] _raw_spin_unlock_irqrestore+0x48/0x8c kernel/locking/spinlock.c:194
hardirqs last disabled at (1110): [<ffff80000bfff6cc>] el1_dbg+0x24/0x5c arch/arm64/kernel/entry-common.c:395
softirqs last enabled at (888): [<ffff8000080102e4>] _stext+0x2e4/0x37c
softirqs last disabled at (681): [<ffff800008104658>] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
softirqs last disabled at (681): [<ffff800008104658>] invoke_softirq+0x70/0xbc kernel/softirq.c:452
---[ end trace 0000000000000000 ]---


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches