================================================================== BUG: KASAN: use-after-free in dx_insert_block fs/ext4/namei.c:1387 [inline] BUG: KASAN: use-after-free in do_split+0x1f31/0x24e0 fs/ext4/namei.c:2080 Read of size 157024 at addr ffff88812b512028 by task syz.3.360/1689 CPU: 1 PID: 1689 Comm: syz.3.360 Not tainted 5.15.178-syzkaller-00018-gc7971fc03a06 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3a0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x177/0x1c0 mm/kasan/report.c:451 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x293/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+0x1f31/0x24e0 fs/ext4/namei.c:2080 make_indexed_dir+0xeb7/0x15a0 fs/ext4/namei.c:2392 ext4_add_entry+0xde2/0x12b0 fs/ext4/namei.c:2504 __ext4_link+0x4e9/0x790 fs/ext4/namei.c:3536 ext4_link+0x1f3/0x290 fs/ext4/namei.c:3577 vfs_link+0x645/0x7f0 fs/namei.c:4557 do_linkat+0x34d/0x9f0 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+0x282/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:87 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f99dfe46169 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:00007f99df8b8038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f99e005efa0 RCX: 00007f99dfe46169 RDX: 0000000000000000 RSI: 0000200000000bc0 RDI: 0000200000001240 RBP: 00007f99dfec72a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f99e005efa0 R15: 00007fff81ef2d48 The buggy address belongs to the page: page:ffffea0004ad4480 refcount:3 mapcount:1 mapping:ffff88810912f9f8 index:0x1 pfn:0x12b512 memcg:ffff888100146000 aops:def_blk_aops ino:700003 flags: 0x400000000032201e(referenced|uptodate|dirty|lru|private|mappedtodisk|unevictable|mlocked|zone=1) raw: 400000000032201e ffffea0004462548 ffffea0004a912c8 ffff88810912f9f8 raw: 0000000000000001 ffff88810fbdb888 0000000300000000 ffff888100146000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 512, ts 155819126808, free_ts 155811229035 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x15d/0x170 mm/page_alloc.c:2420 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3bb6/0x3c90 mm/page_alloc.c:4192 __alloc_pages+0x38a/0x7b0 mm/page_alloc.c:5465 __alloc_pages_node include/linux/gfp.h:570 [inline] alloc_pages_node include/linux/gfp.h:584 [inline] alloc_pages include/linux/gfp.h:597 [inline] __page_cache_alloc include/linux/pagemap.h:304 [inline] page_cache_ra_unbounded+0x2bb/0x760 mm/readahead.c:216 do_page_cache_ra mm/readahead.c:269 [inline] force_page_cache_ra+0x34e/0x3b0 mm/readahead.c:301 page_cache_sync_ra+0x253/0x2c0 mm/readahead.c:575 page_cache_sync_readahead include/linux/pagemap.h:833 [inline] filemap_get_pages mm/filemap.c:2551 [inline] filemap_read+0x6ec/0x21c0 mm/filemap.c:2634 generic_file_read_iter+0xae/0x420 mm/filemap.c:2794 blkdev_read_iter+0x135/0x190 block/fops.c:560 call_read_iter include/linux/fs.h:2166 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xa81/0xd40 fs/read_write.c:485 ksys_read+0x199/0x2c0 fs/read_write.c:623 __do_sys_read fs/read_write.c:633 [inline] __se_sys_read fs/read_write.c:631 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:631 x64_sys_call+0x28/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:1 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1413 [inline] free_unref_page_prepare+0x7a9/0x7e0 mm/page_alloc.c:3317 free_unref_page+0x85/0x220 mm/page_alloc.c:3396 free_the_page mm/page_alloc.c:705 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5541 free_pages+0x7c/0x90 mm/page_alloc.c:5552 ext4_calculate_overhead+0xfb4/0x1190 fs/ext4/super.c:3830 ext4_fill_super+0x74df/0x96e0 fs/ext4/super.c:4819 mount_bdev+0x282/0x3b0 fs/super.c:1400 ext4_mount+0x34/0x40 fs/ext4/super.c:6603 legacy_get_tree+0xee/0x190 fs/fs_context.c:611 vfs_get_tree+0x88/0x290 fs/super.c:1530 do_new_mount+0x2ba/0xb30 fs/namespace.c:3012 path_mount+0x671/0x1070 fs/namespace.c:3342 do_mount fs/namespace.c:3355 [inline] __do_sys_mount fs/namespace.c:3563 [inline] __se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3540 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3540 x64_sys_call+0x49d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff88812b512f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812b512f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88812b513000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88812b513080: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88812b513100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== EXT4-fs error (device loop3): ext4_dx_csum_set:531: inode #2: comm syz.3.360: dir seems corrupt? Run e2fsck -D.