EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor138: error while reading EA inode 1 err=-117 EXT4-fs (loop0): 1 orphan inode deleted EXT4-fs (loop0): mounted filesystem without journal. Quota mode: none. ================================================================== BUG: KASAN: use-after-free in ext4_insert_dentry+0x388/0x710 fs/ext4/namei.c:2155 Write of size 251 at addr ffff8881115dcf14 by task syz-executor138/285 CPU: 0 PID: 285 Comm: syz-executor138 Not tainted 6.1.134-syzkaller-00016-ga0fa2316cce1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x71/0x210 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:427 kasan_report+0x122/0x150 mm/kasan/report.c:531 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x280/0x290 mm/kasan/generic.c:189 memcpy+0x44/0x70 mm/kasan/shadow.c:66 ext4_insert_dentry+0x388/0x710 fs/ext4/namei.c:2155 add_dirent_to_buf+0x2ac/0x670 fs/ext4/namei.c:2200 make_indexed_dir+0xe55/0x14a0 fs/ext4/namei.c:2398 ext4_add_entry+0xb45/0xd70 fs/ext4/namei.c:2504 ext4_add_nondir+0x97/0x270 fs/ext4/namei.c:2845 ext4_symlink+0x842/0x9b0 fs/ext4/namei.c:3482 vfs_symlink+0x261/0x3f0 fs/namei.c:4470 do_symlinkat+0x124/0x5a0 fs/namei.c:4499 __do_sys_symlink fs/namei.c:4521 [inline] __se_sys_symlink fs/namei.c:4519 [inline] __x64_sys_symlink+0x7e/0x90 fs/namei.c:4519 x64_sys_call+0x369/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:89 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:0x7f0bfb1a43b9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 31 1b 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fffe5f9c138 EFLAGS: 00000246 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f0bfb1a43b9 RDX: 0000000000000000 RSI: 0000200000000cc0 RDI: 0000200000000dc0 RBP: 00007f0bfb1e61ad R08: 00007f0bfb1e61dd R09: 00007f0bfb1e61dd R10: 00007f0bfb1e61dd R11: 0000000000000246 R12: 00007f0bfb1e6068 R13: 00007f0bfb1ec87c R14: 00007f0bfb1e612e R15: 0000000000000001 The buggy address belongs to the physical page: page:ffffea0004457700 refcount:3 mapcount:0 mapping:ffff88810ba641d0 index:0x3f pfn:0x1115dc memcg:ffff888100336000 aops:def_blk_aops ino:700000 flags: 0x420000000000204a(referenced|dirty|workingset|private|zone=1) raw: 420000000000204a 0000000000000000 dead000000000122 ffff88810ba641d0 raw: 000000000000003f ffff888124cc9bd0 00000003ffffffff ffff888100336000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x148c48(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 285, tgid 285 (syz-executor138), ts 23155004337, free_ts 17138580189 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2637 prep_new_page+0x1c/0x110 mm/page_alloc.c:2644 get_page_from_freelist+0x2c6e/0x2ce0 mm/page_alloc.c:4539 __alloc_pages+0x19e/0x3a0 mm/page_alloc.c:5838 __folio_alloc+0x12/0x40 mm/page_alloc.c:5870 __folio_alloc_node include/linux/gfp.h:245 [inline] folio_alloc include/linux/gfp.h:274 [inline] filemap_alloc_folio include/linux/pagemap.h:513 [inline] __filemap_get_folio+0x6ec/0x980 mm/filemap.c:2018 pagecache_get_page+0x2b/0x110 mm/folio-compat.c:110 find_or_create_page include/linux/pagemap.h:654 [inline] grow_dev_page fs/buffer.c:989 [inline] grow_buffers fs/buffer.c:1054 [inline] __getblk_slow fs/buffer.c:1081 [inline] __getblk_gfp+0x217/0x7d0 fs/buffer.c:1376 sb_getblk include/linux/buffer_head.h:356 [inline] ext4_getblk+0x26c/0x6d0 fs/ext4/inode.c:899 ext4_bread+0x2b/0x170 fs/ext4/inode.c:945 ext4_append+0x2c3/0x560 fs/ext4/namei.c:83 make_indexed_dir+0x55d/0x14a0 fs/ext4/namei.c:2318 ext4_add_entry+0xb45/0xd70 fs/ext4/namei.c:2504 ext4_add_nondir+0x97/0x270 fs/ext4/namei.c:2845 ext4_symlink+0x842/0x9b0 fs/ext4/namei.c:3482 vfs_symlink+0x261/0x3f0 fs/namei.c:4470 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1545 [inline] free_pcp_prepare mm/page_alloc.c:1619 [inline] free_unref_page_prepare+0x742/0x750 mm/page_alloc.c:3581 free_unref_page_list+0xba/0x7c0 mm/page_alloc.c:3729 release_pages+0xad1/0xb20 mm/swap.c:1043 free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:315 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu mm/mmu_gather.c:261 [inline] tlb_finish_mmu+0x1aa/0x370 mm/mmu_gather.c:361 exit_mmap+0x3c7/0xa40 mm/mmap.c:3359 __mmput+0x93/0x320 kernel/fork.c:1297 mmput+0x4b/0x150 kernel/fork.c:1320 exit_mm kernel/exit.c:568 [inline] do_exit+0x979/0x2650 kernel/exit.c:864 do_group_exit+0x210/0x2d0 kernel/exit.c:1027 __do_sys_exit_group kernel/exit.c:1038 [inline] __se_sys_exit_group kernel/exit.c:1036 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036 x64_sys_call+0x7b4/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 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 Memory state around the buggy address: ffff8881115dcf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881115dcf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881115dd000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^