EXT4-fs (loop0): mounted filesystem without journal. Opts: jqfmt=vfsold,max_batch_time=0x0000000000000001,debug,noload,nombcache,noblock_validity,init_itable=0x0000000000000601,inode_readahead_blks=0x0000000000008000,,errors=continue
==================================================================
BUG: KASAN: use-after-free in ext4_insert_dentry+0x3a0/0x720 fs/ext4/namei.c:2106
Write of size 248 at addr ffff8881d9e79f1c by task syz-executor310/350
CPU: 0 PID: 350 Comm: syz-executor310 Not tainted 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
__dump_stack+0x1e/0x20 lib/dump_stack.c:77
dump_stack+0x15b/0x1b8 lib/dump_stack.c:118
print_address_description+0x8d/0x4c0 mm/kasan/report.c:384
__kasan_report+0xef/0x120 mm/kasan/report.c:516
kasan_report+0x30/0x60 mm/kasan/common.c:653
check_memory_region_inline mm/kasan/generic.c:141 [inline]
check_memory_region+0x274/0x280 mm/kasan/generic.c:191
memcpy+0x3b/0x60 mm/kasan/common.c:124
ext4_insert_dentry+0x3a0/0x720 fs/ext4/namei.c:2106
add_dirent_to_buf+0x2c0/0x6d0 fs/ext4/namei.c:2150
make_indexed_dir+0xd92/0x1490 fs/ext4/namei.c:2341
ext4_add_entry+0xc49/0xed0 fs/ext4/namei.c:2445
ext4_add_nondir fs/ext4/namei.c:2765 [inline]
ext4_create+0x2fb/0x5a0 fs/ext4/namei.c:2807
lookup_open fs/namei.c:3379 [inline]
do_last fs/namei.c:3471 [inline]
path_openat+0x1603/0x35c0 fs/namei.c:3683
do_filp_open+0x1ae/0x3f0 fs/namei.c:3713
do_sys_open+0x2bb/0x5d0 fs/open.c:1123
ksys_open include/linux/syscalls.h:1388 [inline]
__do_sys_creat fs/open.c:1181 [inline]
__se_sys_creat fs/open.c:1179 [inline]
__x64_sys_creat+0x65/0x70 fs/open.c:1179
do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7fb2aabe6fa9
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:00007ffc31124238 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fb2aabe6fa9
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000200000000440
RBP: 0000000000000000 R08: 00007ffc3112426c R09: 00007ffc3112426c
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc3112426c
R13: 0000000000000002 R14: 431bde82d7b634db R15: 00007ffc311242a0
The buggy address belongs to the page:
page:ffffea0007679e40 refcount:3 mapcount:0 mapping:ffff8881f135a038 index:0x3f
def_blk_aops
flags: 0x800000000000202a(referenced|dirty|active|private)
raw: 800000000000202a dead000000000100 dead000000000122 ffff8881f135a038
raw: 000000000000003f ffff8881dcb211f8 00000003ffffffff ffff8881f5cb2000
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff8881f5cb2000
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)
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook mm/page_alloc.c:2165 [inline]
prep_new_page+0x35e/0x370 mm/page_alloc.c:2171
get_page_from_freelist+0x1296/0x1310 mm/page_alloc.c:3794
__alloc_pages_nodemask+0x202/0x4b0 mm/page_alloc.c:4894
__alloc_pages include/linux/gfp.h:503 [inline]
__alloc_pages_node include/linux/gfp.h:516 [inline]
alloc_pages_node include/linux/gfp.h:530 [inline]
__page_cache_alloc include/linux/pagemap.h:218 [inline]
pagecache_get_page+0x48d/0x780 mm/filemap.c:1829
find_or_create_page include/linux/pagemap.h:313 [inline]
grow_dev_page fs/buffer.c:950 [inline]
grow_buffers fs/buffer.c:1019 [inline]
__getblk_slow fs/buffer.c:1046 [inline]
__getblk_gfp+0x212/0x760 fs/buffer.c:1323
sb_getblk include/linux/buffer_head.h:367 [inline]
ext4_getblk+0x18e/0x490 fs/ext4/inode.c:992
ext4_bread+0x8a/0x2d0 fs/ext4/inode.c:1035
ext4_append+0x253/0x470 fs/ext4/namei.c:83
make_indexed_dir+0x4f4/0x1490 fs/ext4/namei.c:2267
ext4_add_entry+0xc49/0xed0 fs/ext4/namei.c:2445
ext4_add_nondir fs/ext4/namei.c:2765 [inline]
ext4_create+0x2fb/0x5a0 fs/ext4/namei.c:2807
lookup_open fs/namei.c:3379 [inline]
do_last fs/namei.c:3471 [inline]
path_openat+0x1603/0x35c0 fs/namei.c:3683
do_filp_open+0x1ae/0x3f0 fs/namei.c:3713
do_sys_open+0x2bb/0x5d0 fs/open.c:1123
ksys_open include/linux/syscalls.h:1388 [inline]
__do_sys_creat fs/open.c:1181 [inline]
__se_sys_creat fs/open.c:1179 [inline]
__x64_sys_creat+0x65/0x70 fs/open.c:1179
do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1176 [inline]
free_pcp_prepare mm/page_alloc.c:1233 [inline]
free_unref_page_prepare+0x2a9/0x3a0 mm/page_alloc.c:3085
free_unref_page_list+0x110/0x4c0 mm/page_alloc.c:3154
release_pages+0xa62/0xaa0 mm/swap.c:842
free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:297
tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:189 [inline]
tlb_flush_mmu mm/mmu_gather.c:196 [inline]
tlb_finish_mmu+0x175/0x300 mm/mmu_gather.c:277
unmap_region+0x32c/0x380 mm/mmap.c:2644
__do_munmap+0x639/0x840 mm/mmap.c:2875
__vm_munmap mm/mmap.c:2898 [inline]
__do_sys_munmap mm/mmap.c:2924 [inline]
__se_sys_munmap+0x124/0x1b0 mm/mmap.c:2920
__x64_sys_munmap+0x5b/0x70 mm/mmap.c:2920
do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
Memory state around the buggy address:
ffff8881d9e79f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881d9e79f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881d9e7a000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881d9e7a080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881d9e7a100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================