================================================================== BUG: KASAN: use-after-free in dx_insert_block fs/ext4/namei.c:1387 [inline] BUG: KASAN: use-after-free in do_split+0x1a78/0x1f70 fs/ext4/namei.c:2080 Read of size 157024 at addr ffff888132810028 by task syz.6.487/2836 CPU: 1 PID: 2836 Comm: syz.6.487 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 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+0xf1/0x140 mm/kasan/report.c:444 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:1387 [inline] do_split+0x1a78/0x1f70 fs/ext4/namei.c:2080 make_indexed_dir+0xe01/0x14a0 fs/ext4/namei.c:2392 ext4_add_entry+0xc24/0xf40 fs/ext4/namei.c:2504 __ext4_link+0x4d7/0x770 fs/ext4/namei.c:3536 ext4_link+0x1de/0x270 fs/ext4/namei.c:3577 vfs_link+0x636/0x7f0 fs/namei.c:4557 do_linkat+0x1e7/0x730 fs/namei.c:4628 __do_sys_link fs/namei.c:4662 [inline] __se_sys_link fs/namei.c:4660 [inline] __x64_sys_link+0x86/0x90 fs/namei.c:4660 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:0x7fc191d78169 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:00007fc1917ea038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007fc191f90fa0 RCX: 00007fc191d78169 RDX: 0000000000000000 RSI: 0000400000000bc0 RDI: 0000400000001240 RBP: 00007fc191df92a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fc191f90fa0 R15: 00007ffe02587978 The buggy address belongs to the page: page:ffffea0004ca0400 refcount:3 mapcount:1 mapping:ffff888109338d98 index:0x1 pfn:0x132810 memcg:ffff888102dce780 aops:def_blk_aops ino:700006 flags: 0x400000000032201e(referenced|uptodate|dirty|lru|private|mappedtodisk|unevictable|mlocked|zone=1) raw: 400000000032201e ffffea00043f8288 ffffea00045c71c8 ffff888109338d98 raw: 0000000000000001 ffff8881115b5738 0000000300000000 ffff888102dce780 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 2836, ts 184910385180, free_ts 184842999195 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5808 __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+0xa82/0xda0 mm/filemap.c:1954 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+0x238/0x7d0 fs/buffer.c:1336 sb_getblk include/linux/buffer_head.h:361 [inline] ext4_getblk+0x210/0x630 fs/ext4/inode.c:878 ext4_bread_batch+0x61/0x4c0 fs/ext4/inode.c:945 __ext4_find_entry+0x1049/0x1bc0 fs/ext4/namei.c:1671 ext4_lookup_entry fs/ext4/namei.c:1774 [inline] ext4_lookup+0x292/0x840 fs/ext4/namei.c:1842 lookup_open fs/namei.c:3440 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0xfcf/0x2f10 fs/namei.c:3739 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x14c/0x7b0 fs/open.c:1234 do_sys_open fs/open.c:1250 [inline] __do_sys_creat fs/open.c:1326 [inline] __se_sys_creat fs/open.c:1320 [inline] __x64_sys_creat+0x8e/0xb0 fs/open.c:1320 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:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x542/0x550 mm/page_alloc.c:3534 free_unref_page_list+0x134/0x9d0 mm/page_alloc.c:3671 release_pages+0xfda/0x1030 mm/swap.c:1014 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+0x175/0x300 mm/mmu_gather.c:338 exit_mmap+0x40f/0x860 mm/mmap.c:3248 __mmput+0x93/0x320 kernel/fork.c:1180 mmput+0x50/0x150 kernel/fork.c:1203 exit_mm kernel/exit.c:554 [inline] do_exit+0x9d2/0x27a0 kernel/exit.c:876 do_group_exit+0x141/0x310 kernel/exit.c:1003 get_signal+0x66a/0x1480 kernel/signal.c:2907 arch_do_signal_or_restart+0xc1/0x10f0 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0xa7/0xe0 kernel/entry/common.c:178 exit_to_user_mode_prepare+0x87/0xd0 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffff888132818f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888132818f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888132819000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888132819080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888132819100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop6): ext4_dx_csum_set:531: inode #2: comm syz.6.487: dir seems corrupt? Run e2fsck -D.