EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor147: 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+0x389/0x720 fs/ext4/namei.c:2155 Write of size 250 at addr ffff888126e61f18 by task syz-executor147/304 CPU: 1 PID: 304 Comm: syz-executor147 Not tainted 6.1.115-syzkaller-00041-ga887a44ace2a #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+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 kasan_check_range+0x294/0x2a0 mm/kasan/generic.c:189 memcpy+0x44/0x70 mm/kasan/shadow.c:66 ext4_insert_dentry+0x389/0x720 fs/ext4/namei.c:2155 add_dirent_to_buf+0x38c/0x780 fs/ext4/namei.c:2200 make_indexed_dir+0xf29/0x1590 fs/ext4/namei.c:2398 ext4_add_entry+0xbbf/0xed0 fs/ext4/namei.c:2504 ext4_mkdir+0x54f/0xce0 fs/ext4/namei.c:3081 vfs_mkdir+0x398/0x570 fs/namei.c:4105 do_mkdirat+0x1eb/0x450 fs/namei.c:4130 __do_sys_mkdirat fs/namei.c:4145 [inline] __se_sys_mkdirat fs/namei.c:4143 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4143 x64_sys_call+0x6c6/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f0b1cf93229 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 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:00007ffd53ecc418 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f0b1cf93229 RDX: 0000000000000000 RSI: 00000000200005c0 RDI: 00000000ffffff9c RBP: 0000000000000000 R08: 00007ffd53ecc450 R09: 00007ffd53ecc450 R10: 00007ffd53ecc450 R11: 0000000000000246 R12: 00007ffd53ecc43c R13: 0000000000000001 R14: 431bde82d7b634db R15: 00007ffd53ecc470 The buggy address belongs to the physical page: page:ffffea00049b9840 refcount:3 mapcount:0 mapping:ffff88810bd714d0 index:0x3f pfn:0x126e61 memcg:ffff888100332000 aops:def_blk_aops ino:700000 flags: 0x420000000000204a(referenced|dirty|workingset|private|zone=1) raw: 420000000000204a 0000000000000000 dead000000000122 ffff88810bd714d0 raw: 000000000000003f ffff888123a97540 00000003ffffffff ffff888100332000 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 304, tgid 304 (syz-executor147), ts 25841549198, free_ts 19952724850 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x2980/0x2a10 mm/page_alloc.c:4439 __alloc_pages+0x234/0x610 mm/page_alloc.c:5728 __folio_alloc+0x15/0x40 mm/page_alloc.c:5760 __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+0x827/0xae0 mm/filemap.c:2017 pagecache_get_page+0x2f/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+0x205/0x7d0 fs/buffer.c:1376 sb_getblk include/linux/buffer_head.h:356 [inline] ext4_getblk+0x2a7/0x7b0 fs/ext4/inode.c:899 ext4_bread+0x2f/0x180 fs/ext4/inode.c:945 ext4_append+0x31f/0x5b0 fs/ext4/namei.c:83 make_indexed_dir+0x518/0x1590 fs/ext4/namei.c:2318 ext4_add_entry+0xbbf/0xed0 fs/ext4/namei.c:2504 ext4_mkdir+0x54f/0xce0 fs/ext4/namei.c:3081 vfs_mkdir+0x398/0x570 fs/namei.c:4105 do_mkdirat+0x1eb/0x450 fs/namei.c:4130 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1498 [inline] free_pcp_prepare mm/page_alloc.c:1572 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3511 free_unref_page_list+0xf1/0x7b0 mm/page_alloc.c:3659 release_pages+0xf7f/0xfe0 mm/swap.c:1063 free_pages_and_swap_cache+0x8a/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+0x1e0/0x3f0 mm/mmu_gather.c:361 unmap_region+0x2c1/0x310 mm/mmap.c:2403 do_mas_align_munmap+0xd05/0x1400 mm/mmap.c:2670 do_mas_munmap+0x23e/0x2b0 mm/mmap.c:2728 __vm_munmap+0x263/0x3a0 mm/mmap.c:3018 __do_sys_munmap mm/mmap.c:3044 [inline] __se_sys_munmap mm/mmap.c:3040 [inline] __x64_sys_munmap+0x6b/0x80 mm/mmap.c:3040 x64_sys_call+0x75/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:12 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff888126e61f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888126e61f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888126e62000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888126e62080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888126e62100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================