syzbot


KASAN: global-out-of-bounds Read in kernfs_find_ns

Status: upstream: reported on 2025/05/31 00:48
Reported-by: syzbot+0c0179aeaef8064ef0bc@syzkaller.appspotmail.com
First crash: 10d, last: 10d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in kernfs_find_ns kernfs 2 1289d 1284d 0/28 auto-closed as invalid on 2022/03/29 00:22
android-54 general protection fault in kernfs_find_ns 1 1481d 1481d 0/2 auto-closed as invalid on 2021/09/18 09:16
android-5-10 general protection fault in kernfs_find_ns C error 13 70d 640d 0/2 upstream: reported C repro on 2023/09/09 18:30
android-54 general protection fault in kernfs_find_ns (2) C 21 70d 1324d 0/2 upstream: reported C repro on 2021/10/24 20:02

Sample crash report:
==================================================================
BUG: KASAN: global-out-of-bounds in kernfs_name_compare fs/kernfs/dir.c:326 [inline]
BUG: KASAN: global-out-of-bounds in kernfs_find_ns+0x473/0x510 fs/kernfs/dir.c:827
Read of size 4 at addr ffffffff8c4bbf68 by task syz-executor/4169

CPU: 1 PID: 4169 Comm: syz-executor Not tainted 5.15.184-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 kernfs_name_compare fs/kernfs/dir.c:326 [inline]
 kernfs_find_ns+0x473/0x510 fs/kernfs/dir.c:827
 kernfs_remove_by_name_ns+0x37/0x100 fs/kernfs/dir.c:1563
 kernfs_remove_by_name include/linux/kernfs.h:598 [inline]
 remove_files fs/sysfs/group.c:28 [inline]
 sysfs_remove_group+0xf8/0x290 fs/sysfs/group.c:289
 sysfs_remove_groups+0x50/0xa0 fs/sysfs/group.c:313
 device_del+0x620/0xa70 drivers/base/core.c:3599
 unregister_netdevice_many+0x141e/0x18f0 net/core/dev.c:11161
 unregister_netdevice_queue+0x31c/0x360 net/core/dev.c:11067
 unregister_netdevice include/linux/netdevice.h:3020 [inline]
 __tun_detach+0xd4a/0x1500 drivers/net/tun.c:686
 tun_detach drivers/net/tun.c:702 [inline]
 tun_chr_close+0x109/0x1b0 drivers/net/tun.c:3440
 __fput+0x234/0x930 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+0x616/0x20a0 kernel/exit.c:874
 do_group_exit+0x12e/0x300 kernel/exit.c:996
 __do_sys_exit_group kernel/exit.c:1007 [inline]
 __se_sys_exit_group kernel/exit.c:1005 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005
 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:0x7fbefd3b0969
Code: Unable to access opcode bytes at RIP 0x7fbefd3b093f.
RSP: 002b:00007ffef7c1c068 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007fbefd432921 RCX: 00007fbefd3b0969
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001
RBP: 0000000000000027 R08: 00007ffef7c19e06 R09: 00007ffef7c1d320
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffef7c1d320
R13: 00007fbefd43289d R14: 0000555590ec54a8 R15: 00007ffef7c1f4e0
 </TASK>

The buggy address belongs to the variable:
 jfs_fs_type+0xe8/0x2a0

Memory state around the buggy address:
 ffffffff8c4bbe00: 00 00 00 00 00 00 00 00 04 f9 f9 f9 00 00 00 00
 ffffffff8c4bbe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffff8c4bbf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9 f9
                                                          ^
 ffffffff8c4bbf80: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
 ffffffff8c4bc000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/31 00:47 linux-5.15.y 98f47d0e9b8c 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: global-out-of-bounds Read in kernfs_find_ns
* Struck through repros no longer work on HEAD.