================================================================== BUG: KASAN: use-after-free in dx_insert_block fs/ext4/namei.c:1387 [inline] BUG: KASAN: use-after-free in do_split+0x1a7c/0x1fa0 fs/ext4/namei.c:2082 Read of size 157024 at addr ffff8881270cb028 by task syz.9.31/559 CPU: 1 PID: 559 Comm: syz.9.31 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x10f/0x150 mm/kasan/report.c:444 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189 memmove+0x2d/0x70 mm/kasan/shadow.c:54 dx_insert_block fs/ext4/namei.c:1387 [inline] do_split+0x1a7c/0x1fa0 fs/ext4/namei.c:2082 make_indexed_dir+0xe78/0x14d0 fs/ext4/namei.c:2394 ext4_add_entry+0xdf1/0x1020 fs/ext4/namei.c:2506 __ext4_link+0x4db/0x760 fs/ext4/namei.c:3538 ext4_link+0x1ee/0x290 fs/ext4/namei.c:3579 vfs_link+0x638/0x7f0 fs/namei.c:4565 do_linkat+0x1e7/0x750 fs/namei.c:4636 __do_sys_link fs/namei.c:4670 [inline] __se_sys_link fs/namei.c:4668 [inline] __x64_sys_link+0x86/0x90 fs/namei.c:4668 x64_sys_call+0x34d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:87 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f8774a840b9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f87744ea028 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f8774cb0fa0 RCX: 00007f8774a840b9 RDX: 0000000000000000 RSI: 0000200000000bc0 RDI: 0000200000001240 RBP: 00007f8774b169c4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8774cb0fa0 R15: 00007fffe458bd08 The buggy address belongs to the page: page:ffffea00049c32c0 refcount:3 mapcount:1 mapping:ffff8881092ca4d8 index:0x1 pfn:0x1270cb memcg:ffff88812dada280 aops:def_blk_aops ino:700009 flags: 0x400000000032201e(referenced|uptodate|dirty|lru|private|mappedtodisk|unevictable|mlocked|zone=1) raw: 400000000032201e ffffea0004be4348 ffffea0004702248 ffff8881092ca4d8 raw: 0000000000000001 ffff88812201a498 0000000300000000 ffff88812dada280 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 559, ts 41695340320, free_ts 41532887065 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2607 prep_new_page+0x1c/0x110 mm/page_alloc.c:2613 get_page_from_freelist+0x2c3a/0x2cd0 mm/page_alloc.c:4487 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5824 __alloc_pages_node include/linux/gfp.h:595 [inline] alloc_pages_node include/linux/gfp.h:609 [inline] alloc_pages include/linux/gfp.h:622 [inline] __page_cache_alloc include/linux/pagemap.h:305 [inline] pagecache_get_page+0xacc/0xdd0 mm/filemap.c:1955 find_or_create_page include/linux/pagemap.h:418 [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+0x231/0x7d0 fs/buffer.c:1336 sb_getblk include/linux/buffer_head.h:361 [inline] ext4_getblk+0x224/0x660 fs/ext4/inode.c:880 ext4_bread_batch+0x66/0x4a0 fs/ext4/inode.c:947 __ext4_find_entry+0x120b/0x1cf0 fs/ext4/namei.c:1673 ext4_lookup_entry fs/ext4/namei.c:1776 [inline] ext4_lookup+0x382/0x930 fs/ext4/namei.c:1844 lookup_open fs/namei.c:3448 [inline] open_last_lookups fs/namei.c:3540 [inline] path_openat+0x1436/0x2f80 fs/namei.c:3747 do_filp_open+0x1df/0x400 fs/namei.c:3777 do_sys_openat2+0x15e/0x7f0 fs/open.c:1236 do_sys_open fs/open.c:1252 [inline] __do_sys_creat fs/open.c:1328 [inline] __se_sys_creat fs/open.c:1322 [inline] __x64_sys_creat+0x8e/0xb0 fs/open.c:1322 x64_sys_call+0x94a/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:86 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1474 [inline] free_pcp_prepare mm/page_alloc.c:1546 [inline] free_unref_page_prepare+0x5fa/0x600 mm/page_alloc.c:3536 free_unref_page_list+0x138/0x9e0 mm/page_alloc.c:3673 release_pages+0x1264/0x12c0 mm/swap.c:1015 free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:320 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+0x17e/0x310 mm/mmu_gather.c:338 exit_mmap+0x43b/0x8b0 mm/mmap.c:3248 __mmput+0x92/0x300 kernel/fork.c:1191 mmput+0x50/0x150 kernel/fork.c:1214 exit_mm kernel/exit.c:561 [inline] do_exit+0xacc/0x29a0 kernel/exit.c:883 do_group_exit+0x149/0x310 kernel/exit.c:1010 get_signal+0x64f/0x1430 kernel/signal.c:2920 arch_do_signal_or_restart+0xe2/0x1100 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:157 [inline] exit_to_user_mode_loop+0xa7/0xe0 kernel/entry/common.c:181 exit_to_user_mode_prepare+0x87/0xd0 kernel/entry/common.c:217 __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline] syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:310 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffff8881270cff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881270cff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881270d0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881270d0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881270d0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop9): ext4_dx_csum_set:531: inode #2: comm syz.9.31: dir seems corrupt? Run e2fsck -D.