EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz.0.18: error while reading EA inode 1 err=-117 EXT4-fs (loop0): 1 orphan inode deleted EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue. Quota mode: none. ================================================================== BUG: KASAN: use-after-free in ext4_insert_dentry+0x366/0x6c0 fs/ext4/namei.c:2155 Write of size 250 at addr ffff88805c264f18 by task syz.0.18/5032 CPU: 0 PID: 5032 Comm: syz.0.18 Not tainted 5.15.173-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189 memcpy+0x3c/0x60 mm/kasan/shadow.c:66 ext4_insert_dentry+0x366/0x6c0 fs/ext4/namei.c:2155 add_dirent_to_buf+0x384/0x7d0 fs/ext4/namei.c:2200 make_indexed_dir+0xf34/0x15a0 fs/ext4/namei.c:2398 ext4_add_entry+0xde2/0x12b0 fs/ext4/namei.c:2504 ext4_mkdir+0x54f/0xce0 fs/ext4/namei.c:3081 vfs_mkdir+0x3b6/0x590 fs/namei.c:4065 do_mkdirat+0x260/0x520 fs/namei.c:4090 __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4103 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fd8357eb809 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd834a69058 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fd8359b0fa0 RCX: 00007fd8357eb809 RDX: 5be60480b9579340 RSI: 0000000020000940 RDI: ffffffffffffff9c RBP: 00007fd83585e93e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd8359b0fa0 R15: 00007ffd6602f498 The buggy address belongs to the page: page:ffffea0001709900 refcount:3 mapcount:0 mapping:ffff888017874f30 index:0x3f pfn:0x5c264 memcg:ffff888075920000 aops:def_blk_aops ino:700000 flags: 0xfff0000000202a(referenced|dirty|active|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff0000000202a 0000000000000000 dead000000000122 ffff888017874f30 raw: 000000000000003f ffff8880711ad0e8 00000003ffffffff ffff888075920000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), pid 5032, ts 117762651204, free_ts 117386519017 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192 __alloc_pages+0x272/0x700 mm/page_alloc.c:5464 __page_cache_alloc+0xd4/0x4a0 mm/filemap.c:1022 pagecache_get_page+0xa91/0x1010 mm/filemap.c:1940 find_or_create_page include/linux/pagemap.h:420 [inline] grow_dev_page fs/buffer.c:949 [inline] grow_buffers fs/buffer.c:1014 [inline] __getblk_slow fs/buffer.c:1041 [inline] __getblk_gfp+0x22a/0xaf0 fs/buffer.c:1336 sb_getblk include/linux/buffer_head.h:361 [inline] ext4_getblk+0x259/0x710 fs/ext4/inode.c:876 ext4_bread+0x2a/0x170 fs/ext4/inode.c:922 ext4_append+0x31f/0x5c0 fs/ext4/namei.c:83 make_indexed_dir+0x515/0x15a0 fs/ext4/namei.c:2318 ext4_add_entry+0xde2/0x12b0 fs/ext4/namei.c:2504 ext4_mkdir+0x54f/0xce0 fs/ext4/namei.c:3081 vfs_mkdir+0x3b6/0x590 fs/namei.c:4065 do_mkdirat+0x260/0x520 fs/namei.c:4090 __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4103 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 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+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page_list+0x1f7/0x8e0 mm/page_alloc.c:3433 release_pages+0x1bb9/0x1f40 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338 unmap_region+0x304/0x350 mm/mmap.c:2668 __do_munmap+0x12db/0x1740 mm/mmap.c:2899 __vm_munmap+0x134/0x230 mm/mmap.c:2922 __do_sys_munmap mm/mmap.c:2948 [inline] __se_sys_munmap mm/mmap.c:2944 [inline] __x64_sys_munmap+0x67/0x70 mm/mmap.c:2944 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff88805c264f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805c264f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805c265000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805c265080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805c265100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================