[v5.15] KASAN: slab-out-of-bounds Read in nilfs_iget_test (3)

0 views
Skip to first unread message

syzbot

unread,
5:07 AM (8 hours ago) 5:07 AM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 91d48252ad4b Linux 5.15.202
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16454b52580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=7e608f0bf7d1d16b5c47
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/74e75dfcb812/disk-91d48252.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bfa72aab00f2/vmlinux-91d48252.xz
kernel image: https://storage.googleapis.com/syzbot-assets/47ea72d1c7dc/bzImage-91d48252.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+7e608f...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-out-of-bounds in nilfs_iget_test+0x9a/0x2e0 fs/nilfs2/inode.c:555
Read of size 8 at addr ffff88806839f1f8 by task syz.6.2334/11764

CPU: 1 PID: 11764 Comm: syz.6.2334 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 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
nilfs_iget_test+0x9a/0x2e0 fs/nilfs2/inode.c:555
find_inode+0x19a/0x3f0 fs/inode.c:898
ilookup5_nowait fs/inode.c:1450 [inline]
ilookup5+0x9f/0x1f0 fs/inode.c:1479
iget5_locked+0x30/0x250 fs/inode.c:1260
nilfs_iget_locked+0xba/0x110 fs/nilfs2/inode.c:616
nilfs_dat_read+0xb5/0x310 fs/nilfs2/dat.c:497
nilfs_load_super_root fs/nilfs2/the_nilfs.c:120 [inline]
load_nilfs+0x3ad/0xea0 fs/nilfs2/the_nilfs.c:301
nilfs_fill_super+0x238/0x520 fs/nilfs2/super.c:1090
nilfs_mount+0x5db/0x8c0 fs/nilfs2/super.c:1347
legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x24a/0xa40 fs/namespace.c:3034
do_mount fs/namespace.c:3377 [inline]
__do_sys_mount fs/namespace.c:3585 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
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:0x7fba3c580a0a
Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007fba3a7d8e58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fba3a7d8ee0 RCX: 00007fba3c580a0a
RDX: 0000200000000040 RSI: 0000200000001f80 RDI: 00007fba3a7d8ea0
RBP: 0000200000000040 R08: 00007fba3a7d8ee0 R09: 0000000000200c04
R10: 0000000000200c04 R11: 0000000000000246 R12: 0000200000001f80
R13: 00007fba3a7d8ea0 R14: 0000000000000b08 R15: 0000200000000100
</TASK>

Allocated by task 11192:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0x9c/0xd0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
slab_alloc mm/slub.c:3233 [inline]
kmem_cache_alloc+0x100/0x290 mm/slub.c:3238
f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2645 [inline]
f2fs_alloc_inode+0x16c/0x5d0 fs/f2fs/super.c:1396
alloc_inode fs/inode.c:261 [inline]
iget_locked+0x191/0x820 fs/inode.c:1308
f2fs_iget+0x52/0x4a50 fs/f2fs/inode.c:505
f2fs_fill_super+0x3c17/0x6de0 fs/f2fs/super.c:4180
mount_bdev+0x287/0x3c0 fs/super.c:1400
legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x24a/0xa40 fs/namespace.c:3034
do_mount fs/namespace.c:3377 [inline]
__do_sys_mount fs/namespace.c:3585 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
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

Last potentially related work creation:
kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:3011 [inline]
call_rcu+0x189/0x950 kernel/rcu/tree.c:3091
destroy_inode fs/inode.c:316 [inline]
evict+0x834/0x8d0 fs/inode.c:662
f2fs_fill_super+0x552e/0x6de0 fs/f2fs/super.c:4492
mount_bdev+0x287/0x3c0 fs/super.c:1400
legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x24a/0xa40 fs/namespace.c:3034
do_mount fs/namespace.c:3377 [inline]
__do_sys_mount fs/namespace.c:3585 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
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

Second to last potentially related work creation:
kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:3011 [inline]
call_rcu+0x189/0x950 kernel/rcu/tree.c:3091
destroy_inode fs/inode.c:316 [inline]
evict+0x834/0x8d0 fs/inode.c:662
f2fs_put_super+0x720/0xcb0 fs/f2fs/super.c:1631
generic_shutdown_super+0x130/0x300 fs/super.c:475
kill_block_super+0x7c/0xe0 fs/super.c:1427
kill_f2fs_super+0x309/0x3c0 fs/f2fs/super.c:4568
deactivate_locked_super+0x93/0xf0 fs/super.c:335
cleanup_mnt+0x42d/0x4e0 fs/namespace.c:1148
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:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff88806839e880
which belongs to the cache f2fs_inode_cache of size 2304
The buggy address is located 120 bytes to the right of
2304-byte region [ffff88806839e880, ffff88806839f180)
The buggy address belongs to the page:
page:ffffea0001a0e600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88806839e880 pfn:0x68398
head:ffffea0001a0e600 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff8880600f7f01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff88801e8dba00
raw: ffff88806839e880 00000000800d000c 00000001ffffffff ffff8880600f7f01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 5504, ts 100055537063, free_ts 97012708873
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1bbd/0x1ca0 mm/page_alloc.c:4192
__alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
alloc_slab_page mm/slub.c:1780 [inline]
allocate_slab mm/slub.c:1917 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1980
___slab_alloc+0x80a/0xdd0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
slab_alloc mm/slub.c:3233 [inline]
kmem_cache_alloc+0x195/0x290 mm/slub.c:3238
f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2645 [inline]
f2fs_alloc_inode+0x16c/0x5d0 fs/f2fs/super.c:1396
alloc_inode fs/inode.c:261 [inline]
iget_locked+0x191/0x820 fs/inode.c:1308
f2fs_iget+0x52/0x4a50 fs/f2fs/inode.c:505
f2fs_fill_super+0x3c17/0x6de0 fs/f2fs/super.c:4180
mount_bdev+0x287/0x3c0 fs/super.c:1400
legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x24a/0xa40 fs/namespace.c:3034
do_mount fs/namespace.c:3377 [inline]
__do_sys_mount fs/namespace.c:3585 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
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
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396
qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
slab_alloc mm/slub.c:3233 [inline]
__kmalloc+0x127/0x330 mm/slub.c:4408
kmalloc include/linux/slab.h:612 [inline]
tomoyo_realpath_from_path+0x118/0x610 security/tomoyo/realpath.c:254
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x23f/0x5d0 security/tomoyo/file.c:822
security_inode_getattr+0xcf/0x120 security/security.c:1348
vfs_getattr+0x26/0x3a0 fs/stat.c:157
vfs_fstat fs/stat.c:182 [inline]
__do_sys_newfstat fs/stat.c:421 [inline]
__se_sys_newfstat fs/stat.c:418 [inline]
__x64_sys_newfstat+0x137/0x210 fs/stat.c:418
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

Memory state around the buggy address:
ffff88806839f080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88806839f100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88806839f180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88806839f200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88806839f280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages