================================================================== BUG: KASAN: use-after-free in strlen+0x53/0x60 lib/string.c:502 Read of size 1 at addr ffff888054e68008 by task syz-executor/8632 CPU: 0 PID: 8632 Comm: syz-executor Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0xa8/0x210 mm/kasan/report.c:420 kasan_report+0x10b/0x140 mm/kasan/report.c:524 strlen+0x53/0x60 lib/string.c:502 __fortify_strlen include/linux/fortify-string.h:196 [inline] set_de_name_and_namelen fs/reiserfs/namei.c:82 [inline] search_by_entry_key+0xa84/0x1370 fs/reiserfs/namei.c:172 reiserfs_readdir_inode+0x22c/0x1230 fs/reiserfs/dir.c:98 iterate_dir+0x218/0x560 fs/readdir.c:-1 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0xe5/0x260 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fc0f4bc20b3 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 62 3d f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8 RSP: 002b:00007ffd3f8c4ff8 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555573895600 RCX: 00007fc0f4bc20b3 RDX: 0000000000008000 RSI: 0000555573895600 RDI: 0000000000000005 RBP: 00005555738955d4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 00005555738955d0 R15: 00007ffd3f8c72b0 The buggy address belongs to the physical page: page:ffffea0001539a00 refcount:1 mapcount:0 mapping:ffff88807ca46868 index:0x156 pfn:0x54e68 memcg:ffff8880613d8000 aops:shmem_aops ino:5c2 dentry name(?):"memfd:syzkaller" flags: 0xfff6000008001e(referenced|uptodate|dirty|lru|swapbacked|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff6000008001e ffffea00011122c8 ffffea0001539a48 ffff88807ca46868 raw: 0000000000000156 0000000000000000 00000001ffffffff ffff8880613d8000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 9838, tgid 9837 (syz.8.1147), ts 461788728390, free_ts 458883202381 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614 __folio_alloc+0xe/0x30 mm/page_alloc.c:5646 vma_alloc_folio+0x4a3/0x900 mm/mempolicy.c:2243 shmem_alloc_folio mm/shmem.c:1589 [inline] shmem_alloc_and_acct_folio+0x42e/0xb60 mm/shmem.c:1613 shmem_get_folio_gfp+0x1361/0x3400 mm/shmem.c:1941 shmem_get_folio mm/shmem.c:2072 [inline] shmem_write_begin+0xee/0x3f0 mm/shmem.c:2556 generic_perform_write+0x2f7/0x5a0 mm/filemap.c:3862 __generic_file_write_iter+0x148/0x2a0 mm/filemap.c:3960 generic_file_write_iter+0xab/0x2e0 mm/filemap.c:3989 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x44c/0x960 fs/read_write.c:584 ksys_write+0x143/0x240 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare mm/page_alloc.c:1509 [inline] free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384 free_unref_page_list+0xbb/0x8e0 mm/page_alloc.c:3525 release_pages+0x1f92/0x2200 mm/swap.c:1035 __pagevec_release+0x6d/0xe0 mm/swap.c:1055 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] shmem_undo_range+0x75b/0x2050 mm/shmem.c:946 shmem_truncate_range mm/shmem.c:1062 [inline] shmem_evict_inode+0x248/0xa40 mm/shmem.c:1171 evict+0x485/0x870 fs/inode.c:705 __dentry_kill+0x431/0x650 fs/dcache.c:611 dentry_kill+0xb8/0x290 fs/dcache.c:-1 dput+0xfa/0x1d0 fs/dcache.c:918 __fput+0x5e0/0x920 fs/file_table.c:328 task_work_run+0x1ca/0x250 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87 Memory state around the buggy address: ffff888054e67f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888054e67f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888054e68000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888054e68080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888054e68100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================