EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz.0.15: inode #1: comm syz.0.15: iget: illegal inode # EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz.0.15: 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 ffff888060257f18 by task syz.0.15/4986 CPU: 0 PID: 4986 Comm: syz.0.15 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:0x7f59a32e6809 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:00007f59a2564058 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f59a34abfa0 RCX: 00007f59a32e6809 RDX: 5be60480b9579340 RSI: 0000000020000940 RDI: ffffffffffffff9c RBP: 00007f59a335993e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f59a34abfa0 R15: 00007ffc3c387528 The buggy address belongs to the page: page:ffffea00018095c0 refcount:3 mapcount:0 mapping:ffff888145a84f30 index:0x3f pfn:0x60257 memcg:ffff888076a18000 aops:def_blk_aops ino:700000 flags: 0xfff0000000202a(referenced|dirty|active|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff0000000202a 0000000000000000 dead000000000122 ffff888145a84f30 raw: 000000000000003f ffff88807ec071d0 00000003ffffffff ffff888076a18000 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 4986, ts 114104124513, free_ts 112947201668 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 exit_mmap+0x3cd/0x670 mm/mmap.c:3188 __mmput+0x112/0x3b0 kernel/fork.c:1127 exit_mm+0x688/0x7f0 kernel/exit.c:550 do_exit+0x626/0x2480 kernel/exit.c:861 do_group_exit+0x144/0x310 kernel/exit.c:996 __do_sys_exit_group kernel/exit.c:1007 [inline] __se_sys_exit_group kernel/exit.c:1005 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005 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: ffff888060257f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888060257f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888060258000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888060258080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888060258100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================