BUG: KASAN: use-after-free in dx_insert_block+0xd9/0x240 fs/ext4/namei.c:1387 Read of size 157024 at addr ffff888132845028 by task syz.2.18/523 CPU: 1 PID: 523 Comm: syz.2.18 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x71/0x200 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:420 kasan_report+0x122/0x150 mm/kasan/report.c:524 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x280/0x290 mm/kasan/generic.c:189 memmove+0x2d/0x70 mm/kasan/shadow.c:54 dx_insert_block+0xd9/0x240 fs/ext4/namei.c:1387 do_split+0x19f0/0x1d90 fs/ext4/namei.c:2080 make_indexed_dir+0xe06/0x14a0 fs/ext4/namei.c:2392 ext4_add_entry+0xb45/0xd70 fs/ext4/namei.c:2504 __ext4_link+0x4d7/0x770 fs/ext4/namei.c:3522 ext4_link+0x1de/0x270 fs/ext4/namei.c:3563 vfs_link+0x64b/0x800 fs/namei.c:4598 do_linkat+0x1e7/0x730 fs/namei.c:4669 __do_sys_link fs/namei.c:4703 [inline] __se_sys_link fs/namei.c:4701 [inline] __x64_sys_link+0x86/0x90 fs/namei.c:4701 x64_sys_call+0x266/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:87 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f4718b8d169 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:00007f471990a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f4718da5fa0 RCX: 00007f4718b8d169 RDX: 0000000000000000 RSI: 0000200000000bc0 RDI: 0000200000001240 RBP: 00007f4718c0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4718da5fa0 R15: 00007ffe2545b798 The buggy address belongs to the physical page: page:ffffea0004ca1140 refcount:3 mapcount:1 mapping:ffff888100545850 index:0x1 pfn:0x132845 memcg:ffff88810033ba80 aops:def_blk_aops ino:700002 flags: 0x460000000032205e(referenced|uptodate|dirty|lru|workingset|private|mappedtodisk|unevictable|mlocked|zone=1) raw: 460000000032205e dead000000000100 dead000000000001 ffff888100545850 raw: 0000000000000001 ffff88812e083000 0000000300000000 ffff88810033ba80 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 459, tgid 459 (udevd), ts 51176974484, free_ts 49806133245 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2643 prep_new_page+0x1c/0x110 mm/page_alloc.c:2650 get_page_from_freelist+0x2c7b/0x2cf0 mm/page_alloc.c:4554 __alloc_pages+0x1c3/0x450 mm/page_alloc.c:5868 __folio_alloc+0x12/0x40 mm/page_alloc.c:5900 __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] page_cache_ra_unbounded+0x234/0x720 mm/readahead.c:260 do_page_cache_ra mm/readahead.c:312 [inline] force_page_cache_ra mm/readahead.c:343 [inline] page_cache_sync_ra+0x3e3/0x490 mm/readahead.c:727 page_cache_sync_readahead include/linux/pagemap.h:1257 [inline] filemap_get_pages mm/filemap.c:2690 [inline] filemap_read+0x62d/0x22c0 mm/filemap.c:2785 blkdev_read_iter+0x41e/0x560 block/fops.c:614 call_read_iter include/linux/fs.h:2276 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x41e/0x8c0 fs/read_write.c:470 ksys_read+0x140/0x240 fs/read_write.c:613 __do_sys_read fs/read_write.c:623 [inline] __se_sys_read fs/read_write.c:621 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:621 x64_sys_call+0x2f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:1 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1551 [inline] free_pcp_prepare mm/page_alloc.c:1625 [inline] free_unref_page_prepare+0x742/0x750 mm/page_alloc.c:3589 free_unref_page+0x8f/0x530 mm/page_alloc.c:3687 free_the_page mm/page_alloc.c:836 [inline] __free_pages+0x67/0x100 mm/page_alloc.c:5957 free_pages+0x82/0x90 mm/page_alloc.c:5968 kasan_depopulate_vmalloc_pte+0x6b/0x90 mm/kasan/shadow.c:375 apply_to_pte_range mm/memory.c:2687 [inline] apply_to_pmd_range mm/memory.c:2731 [inline] apply_to_pud_range mm/memory.c:2767 [inline] apply_to_p4d_range mm/memory.c:2803 [inline] __apply_to_page_range+0x8de/0xc80 mm/memory.c:2839 apply_to_existing_page_range+0x38/0x50 mm/memory.c:2872 kasan_release_vmalloc+0x97/0xb0 mm/kasan/shadow.c:492 __purge_vmap_area_lazy+0xd47/0x1850 mm/vmalloc.c:1791 drain_vmap_area_work+0x3e/0xd0 mm/vmalloc.c:1820 process_one_work+0x71f/0xc40 kernel/workqueue.c:2302 worker_thread+0xa29/0x11f0 kernel/workqueue.c:2449 kthread+0x281/0x320 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88813284bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88813284bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88813284c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88813284c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88813284c100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop2): ext4_dx_csum_set:531: inode #2: comm syz.2.18: dir seems corrupt? Run e2fsck -D.