================================================================== BUG: KASAN: slab-use-after-free in dx_insert_block+0xe8/0x260 fs/ext4/namei.c:1387 Read of size 157024 at addr ffff88810af2e028 by task syz.1.17/529 CPU: 1 UID: 0 PID: 529 Comm: syz.1.17 Not tainted 6.14.0-rc7-syzkaller-00205-g586de92313fc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x184/0x200 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x163/0x570 mm/kasan/report.c:521 kasan_report+0x15f/0x190 mm/kasan/report.c:634 kasan_check_range+0x238/0x2b0 mm/kasan/generic.c:189 __asan_memmove+0x2d/0x70 mm/kasan/shadow.c:94 dx_insert_block+0xe8/0x260 fs/ext4/namei.c:1387 do_split+0x1c21/0x2160 fs/ext4/namei.c:2043 make_indexed_dir+0xc38/0x1270 fs/ext4/namei.c:2355 ext4_add_entry+0xb32/0xd20 fs/ext4/namei.c:2462 __ext4_link+0x493/0x740 fs/ext4/namei.c:3480 ext4_link+0x1f3/0x290 fs/ext4/namei.c:3521 vfs_link+0x4e8/0x6d0 fs/namei.c:4795 do_linkat+0x2e1/0x690 fs/namei.c:4865 __do_sys_link fs/namei.c:4899 [inline] __se_sys_link fs/namei.c:4897 [inline] __x64_sys_link+0x82/0x90 fs/namei.c:4897 x64_sys_call+0x2d43/0x2df0 arch/x86/include/generated/asm/syscalls_64.h:87 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x50/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f83a1b8cde9 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:00007f83a29f6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f83a1da6080 RCX: 00007f83a1b8cde9 RDX: 0000000000000000 RSI: 0000400000000bc0 RDI: 0000400000001240 RBP: 00007f83a1c0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f83a1da6080 R15: 00007fffe5bae918 The buggy address belongs to the physical page: page: refcount:3 mapcount:1 mapping:ffff88811048bb20 index:0x1 pfn:0x10af2e memcg:ffff88810226f000 aops:def_blk_aops ino:700001 dentry name(?):"" flags: 0x4600000000144a3c(referenced|uptodate|dirty|lru|workingset|owner_2|private|unevictable|mlocked|zone=1) raw: 4600000000144a3c dead000000000100 dead000000000001 ffff88811048bb20 raw: 0000000000000001 ffff888120a5e3f0 0000000300000000 ffff88810226f000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 434, tgid 434 (udevd), ts 55133059629, free_ts 55098361797 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1db/0x200 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x47ee/0x4880 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x3c3/0x7d0 mm/page_alloc.c:4740 __alloc_pages_noprof mm/page_alloc.c:4774 [inline] __folio_alloc_noprof+0x14/0xc0 mm/page_alloc.c:4784 __folio_alloc_node_noprof include/linux/gfp.h:276 [inline] folio_alloc_noprof include/linux/gfp.h:311 [inline] filemap_alloc_folio_noprof include/linux/pagemap.h:668 [inline] ractl_alloc_folio mm/readahead.c:186 [inline] page_cache_ra_unbounded+0x32e/0x6a0 mm/readahead.c:270 do_page_cache_ra mm/readahead.c:327 [inline] force_page_cache_ra mm/readahead.c:356 [inline] page_cache_sync_ra+0x3d6/0x9c0 mm/readahead.c:575 filemap_get_pages+0x5e1/0x1d10 mm/filemap.c:2590 filemap_read+0x42e/0xf80 mm/filemap.c:2701 blkdev_read_iter+0x317/0x470 block/fops.c:796 new_sync_read fs/read_write.c:484 [inline] vfs_read+0x8eb/0xd90 fs/read_write.c:565 ksys_read+0x188/0x2b0 fs/read_write.c:708 __do_sys_read fs/read_write.c:717 [inline] __se_sys_read fs/read_write.c:715 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:715 x64_sys_call+0x2831/0x2df0 arch/x86/include/generated/asm/syscalls_64.h:1 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x50/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e page last free pid 434 tgid 434 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0x9d2/0xa50 mm/page_alloc.c:2660 __free_slab+0xcb/0x110 mm/slub.c:2655 free_slab+0x24/0xd0 mm/slub.c:2678 discard_slab+0x23/0x30 mm/slub.c:2684 __slab_free+0x27c/0x300 mm/slub.c:4520 do_slab_free mm/slub.c:4561 [inline] ___cache_free+0xd1/0xe0 mm/slub.c:4667 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0xb7/0x130 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x150/0x180 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x24/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4115 [inline] slab_alloc_node mm/slub.c:4164 [inline] kmem_cache_alloc_noprof+0x108/0x2b0 mm/slub.c:4171 getname_flags+0xb7/0x530 fs/namei.c:139 getname+0x17/0x20 fs/namei.c:223 getname_maybe_null include/linux/fs.h:2860 [inline] vfs_fstatat+0x42/0x150 fs/stat.c:363 __do_sys_newfstatat fs/stat.c:532 [inline] __se_sys_newfstatat+0xcd/0x760 fs/stat.c:526 __x64_sys_newfstatat+0x9b/0xb0 fs/stat.c:526 x64_sys_call+0x23a8/0x2df0 arch/x86/include/generated/asm/syscalls_64.h:263 Memory state around the buggy address: ffff88810af2ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88810af2ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88810af30000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810af30080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff88810af30100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop1): ext4_dx_csum_set:531: inode #2: comm syz.1.17: dir seems corrupt? Run e2fsck -D.