================================================================== BUG: KASAN: use-after-free in dx_insert_block fs/ext4/namei.c:1358 [inline] BUG: KASAN: use-after-free in do_split+0x1995/0x1e30 fs/ext4/namei.c:2044 Read of size 157024 at addr ffff88810c287028 by task syz.8.29/569 CPU: 0 PID: 569 Comm: syz.8.29 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:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0xe2/0x130 mm/kasan/report.c:452 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 fs/ext4/namei.c:1358 [inline] do_split+0x1995/0x1e30 fs/ext4/namei.c:2044 make_indexed_dir+0xd58/0x13f0 fs/ext4/namei.c:2348 ext4_add_entry+0xc05/0xf10 fs/ext4/namei.c:2460 __ext4_link+0x4db/0x760 fs/ext4/namei.c:3647 ext4_link+0x1de/0x270 fs/ext4/namei.c:3688 vfs_link+0x684/0x880 fs/namei.c:4213 do_linkat+0x381/0x660 fs/namei.c:4281 __do_sys_link fs/namei.c:4310 [inline] __se_sys_link fs/namei.c:4308 [inline] __x64_sys_link+0x68/0x80 fs/namei.c:4308 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f0c0a987819 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:00007f0c0a408038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f0c0ab3efa0 RCX: 00007f0c0a987819 RDX: 0000000000000000 RSI: 0000000020000bc0 RDI: 0000000020001240 RBP: 00007f0c0a9fa75e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f0c0ab3efa0 R15: 00007ffec4ec63c8 The buggy address belongs to the page: page:ffffea000430a1c0 refcount:3 mapcount:1 mapping:ffff8881103828d0 index:0x1 pfn:0x10c287 aops:def_blk_aops ino:0 flags: 0x400000000032201e(referenced|uptodate|dirty|lru|private|mappedtodisk|unevictable|mlocked) raw: 400000000032201e ffff888100195040 ffffea000421ee88 ffff8881103828d0 raw: 0000000000000001 ffff88812083c9d8 0000000300000000 ffff88810013a000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff88810013a000 page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 496, ts 51230428423, free_ts 51229980581 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x179/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5370 __alloc_pages include/linux/gfp.h:544 [inline] __alloc_pages_node include/linux/gfp.h:557 [inline] alloc_pages_node include/linux/gfp.h:571 [inline] alloc_pages include/linux/gfp.h:590 [inline] __page_cache_alloc include/linux/pagemap.h:290 [inline] page_cache_ra_unbounded+0x2c8/0x7d0 mm/readahead.c:226 do_page_cache_ra mm/readahead.c:277 [inline] force_page_cache_ra+0x3a9/0x400 mm/readahead.c:308 page_cache_sync_ra+0x237/0x2a0 mm/readahead.c:582 page_cache_sync_readahead include/linux/pagemap.h:837 [inline] generic_file_buffered_read+0x55b/0x2730 mm/filemap.c:2250 generic_file_read_iter+0x116/0x560 mm/filemap.c:2568 blkdev_read_iter+0x12f/0x160 fs/block_dev.c:1956 call_read_iter include/linux/fs.h:2060 [inline] new_sync_read fs/read_write.c:415 [inline] vfs_read+0x874/0xa10 fs/read_write.c:496 ksys_read+0x140/0x240 fs/read_write.c:634 __do_sys_read fs/read_write.c:644 [inline] __se_sys_read fs/read_write.c:642 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:642 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2b7/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x12e/0x9b0 mm/page_alloc.c:3443 release_pages+0xe38/0xe80 mm/swap.c:1103 __pagevec_release+0x71/0xe0 mm/swap.c:1123 pagevec_release include/linux/pagevec.h:88 [inline] truncate_inode_pages_range+0xea5/0x15b0 mm/truncate.c:450 truncate_inode_pages+0x24/0x30 mm/truncate.c:473 kill_bdev fs/block_dev.c:86 [inline] set_blocksize+0x34f/0x3c0 fs/block_dev.c:171 sb_set_blocksize fs/block_dev.c:180 [inline] sb_min_blocksize+0xfc/0x1d0 fs/block_dev.c:196 ext4_fill_super+0x64b/0x8b60 fs/ext4/super.c:4060 mount_bdev+0x28b/0x3a0 fs/super.c:1442 ext4_mount+0x34/0x40 fs/ext4/super.c:6662 legacy_get_tree+0xed/0x190 fs/fs_context.c:593 vfs_get_tree+0x89/0x260 fs/super.c:1572 do_new_mount+0x25a/0xa20 fs/namespace.c:2997 path_mount+0x572/0xc80 fs/namespace.c:3327 do_mount fs/namespace.c:3340 [inline] __do_sys_mount fs/namespace.c:3548 [inline] __se_sys_mount+0x318/0x380 fs/namespace.c:3525 Memory state around the buggy address: ffff88810c289f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88810c289f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88810c28a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810c28a080: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff88810c28a100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop8): ext4_dx_csum_set:529: inode #2: comm syz.8.29: dir seems corrupt? Run e2fsck -D.