================================================================== BUG: KASAN: use-after-free in dx_insert_block fs/ext4/namei.c:1358 [inline] BUG: KASAN: use-after-free in do_split+0x19d7/0x1e90 fs/ext4/namei.c:2044 Read of size 157024 at addr ffff8881324bd028 by task syz.3.141/958 CPU: 1 PID: 958 Comm: syz.3.141 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x1a7/0x208 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+0x100/0x140 mm/kasan/report.c:452 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:1358 [inline] do_split+0x19d7/0x1e90 fs/ext4/namei.c:2044 make_indexed_dir+0xe14/0x1460 fs/ext4/namei.c:2348 ext4_add_entry+0xd80/0xf90 fs/ext4/namei.c:2460 __ext4_link+0x4d6/0x760 fs/ext4/namei.c:3647 ext4_link+0x1ee/0x290 fs/ext4/namei.c:3688 vfs_link+0x684/0x880 fs/namei.c:4263 do_linkat+0x381/0x670 fs/namei.c:4331 __do_sys_link fs/namei.c:4360 [inline] __se_sys_link fs/namei.c:4358 [inline] __x64_sys_link+0x68/0x80 fs/namei.c:4358 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fad206b23b9 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:00007fad20121028 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007fad208b7fa0 RCX: 00007fad206b23b9 RDX: 0000000000000000 RSI: 0000000020000bc0 RDI: 0000000020001240 RBP: 00007fad2073d9d4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fad208b7fa0 R15: 00007ffe10b257a8 The buggy address belongs to the page: page:ffffea0004c92f40 refcount:3 mapcount:1 mapping:ffff888110757e10 index:0x1 pfn:0x1324bd aops:def_blk_aops ino:0 flags: 0x400000000032201e(referenced|uptodate|dirty|lru|private|mappedtodisk|unevictable|mlocked) raw: 400000000032201e ffffea0004441a08 ffffea0004752e48 ffff888110757e10 raw: 0000000000000001 ffff888110716e70 0000000300000000 ffff8881292ce000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8881292ce000 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 958, ts 78844709769, free_ts 78828865324 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x176/0x190 mm/page_alloc.c:2462 get_page_from_freelist+0x225f/0x23f0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x29a/0x640 mm/page_alloc.c:5384 __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] pagecache_get_page+0x63e/0x930 mm/filemap.c:1848 find_or_create_page include/linux/pagemap.h:402 [inline] grow_dev_page fs/buffer.c:976 [inline] grow_buffers fs/buffer.c:1045 [inline] __getblk_slow fs/buffer.c:1072 [inline] __getblk_gfp+0x212/0x780 fs/buffer.c:1370 sb_getblk include/linux/buffer_head.h:361 [inline] ext4_getblk fs/ext4/inode.c:880 [inline] ext4_bread_batch+0x1de/0x790 fs/ext4/inode.c:946 __ext4_find_entry+0xf1f/0x1930 fs/ext4/namei.c:1643 ext4_lookup_entry fs/ext4/namei.c:1746 [inline] ext4_lookup+0x305/0x8c0 fs/ext4/namei.c:1814 lookup_open fs/namei.c:3276 [inline] open_last_lookups fs/namei.c:3367 [inline] path_openat+0x145d/0x3040 fs/namei.c:3556 do_filp_open+0x1df/0x400 fs/namei.c:3586 do_sys_openat2+0x19f/0x750 fs/open.c:1219 do_sys_open fs/open.c:1235 [inline] __do_sys_creat fs/open.c:1311 [inline] __se_sys_creat fs/open.c:1305 [inline] __x64_sys_creat+0x8e/0xb0 fs/open.c:1305 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+0x129/0x9c0 mm/page_alloc.c:3443 release_pages+0xe41/0xe90 mm/swap.c:1103 __pagevec_release+0x71/0xe0 mm/swap.c:1123 pagevec_release include/linux/pagevec.h:88 [inline] shmem_undo_range+0x741/0x1740 mm/shmem.c:965 shmem_truncate_range mm/shmem.c:1069 [inline] shmem_evict_inode+0x1dc/0x970 mm/shmem.c:1169 evict+0x4a9/0x940 fs/inode.c:612 iput_final fs/inode.c:1736 [inline] iput+0x654/0x7e0 fs/inode.c:1762 dentry_unlink_inode+0x2d5/0x390 fs/dcache.c:378 __dentry_kill+0x45b/0x660 fs/dcache.c:583 dentry_kill+0xc0/0x2a0 fs/dcache.c:-1 dput+0x42/0x80 fs/dcache.c:883 __fput+0x4bd/0x730 fs/file_table.c:294 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x127/0x190 kernel/task_work.c:189 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xcb/0xe0 kernel/entry/common.c:175 Memory state around the buggy address: ffff8881324c2f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881324c2f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881324c3000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881324c3080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881324c3100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop3): ext4_dx_csum_set:529: inode #2: comm syz.3.141: dir seems corrupt? Run e2fsck -D.