================================================================== 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 ffff88810e235028 by task syz.5.17/595 CPU: 0 PID: 595 Comm: syz.5.17 Not tainted 5.15.178-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 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 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:0x7fe48e930de9 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:00007fe48e382038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007fe48eb4a080 RCX: 00007fe48e930de9 RDX: 0000000000000000 RSI: 0000400000000bc0 RDI: 0000400000001240 RBP: 00007fe48e9b22a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe48eb4a080 R15: 00007fff2d189108 The buggy address belongs to the page: page:ffffea0004388d40 refcount:3 mapcount:1 mapping:ffff8881091291f8 index:0x1 pfn:0x10e235 memcg:ffff888100144000 aops:def_blk_aops ino:700005 flags: 0x400000000032201e(referenced|uptodate|dirty|lru|private|mappedtodisk|unevictable|mlocked|zone=1) raw: 400000000032201e ffff888100077040 ffffea00045f0048 ffff8881091291f8 raw: 0000000000000001 ffff88812c10e930 0000000300000000 ffff888100144000 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 514, ts 59701010632, free_ts 59684520465 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:2168 [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_slab+0xec/0x1d0 mm/slub.c:2000 free_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] __unfreeze_partials+0x165/0x1a0 mm/slub.c:2507 put_cpu_partial+0xc4/0x120 mm/slub.c:2587 __slab_free+0x1c8/0x290 mm/slub.c:3368 do_slab_free mm/slub.c:3487 [inline] ___cache_free+0x109/0x120 mm/slub.c:3506 qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x44/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3233 getname_flags+0xba/0x520 fs/namei.c:138 user_path_at_empty+0x2d/0x1a0 fs/namei.c:2882 Memory state around the buggy address: ffff88810e235f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88810e235f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88810e236000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88810e236080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88810e236100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop5): ext4_dx_csum_set:531: inode #2: comm syz.5.17: dir seems corrupt? Run e2fsck -D.