================================================================== BUG: KASAN: use-after-free in dx_insert_block+0xd9/0x240 fs/ext4/namei.c:1355 Read of size 157024 at addr ffff8881364dc028 by task syz.4.95/988 CPU: 1 UID: 0 PID: 988 Comm: syz.4.95 Not tainted 6.16.0-rc6-syzkaller-00002-g155a3c003e55 #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:94 dump_stack_lvl+0x107/0x170 lib/dump_stack.c:120 print_address_description+0x72/0x1f0 mm/kasan/report.c:378 print_report+0x5b/0x70 mm/kasan/report.c:480 kasan_report+0x15f/0x1a0 mm/kasan/report.c:593 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:189 __asan_memmove+0x2d/0x80 mm/kasan/shadow.c:94 dx_insert_block+0xd9/0x240 fs/ext4/namei.c:1355 do_split+0x1978/0x1e40 fs/ext4/namei.c:2017 make_indexed_dir+0xc3d/0x11f0 fs/ext4/namei.c:2328 ext4_add_entry+0xaa4/0xc20 fs/ext4/namei.c:2435 __ext4_link+0x498/0x720 fs/ext4/namei.c:3464 ext4_link+0x1de/0x280 fs/ext4/namei.c:3505 vfs_link+0x4dc/0x6d0 fs/namei.c:4863 do_linkat+0x1e5/0x460 fs/namei.c:4933 __do_sys_link fs/namei.c:4967 [inline] __se_sys_link fs/namei.c:4965 [inline] __x64_sys_link+0x82/0x90 fs/namei.c:4965 x64_sys_call+0x2a6e/0x2f60 arch/x86/include/generated/asm/syscalls_64.h:87 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x5e/0x160 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f5e80d8cde9 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:00007f5e81b08038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f5e80fa6080 RCX: 00007f5e80d8cde9 RDX: 0000000000000000 RSI: 0000400000000bc0 RDI: 0000400000001240 RBP: 00007f5e80e0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f5e80fa6080 R15: 00007ffd3cc493b8 The buggy address belongs to the physical page: page: refcount:3 mapcount:1 mapping:ffff88811048bb20 index:0x1 pfn:0x1364dc memcg:ffff888102a68700 aops:def_blk_aops ino:700004 dentry name(?):"" flags: 0x4600000000144a3c(referenced|uptodate|dirty|lru|workingset|owner_2|private|unevictable|mlocked|zone=1) raw: 4600000000144a3c dead000000000100 dead000000000001 ffff88811048bb20 raw: 0000000000000001 ffff8881216ac0a8 0000000300000000 ffff888102a68700 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 586, tgid 586 (udevd), ts 76809746725, free_ts 76791120005 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x280 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x2086/0x2140 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x2b7/0x4f0 mm/page_alloc.c:4959 __alloc_pages_noprof mm/page_alloc.c:4993 [inline] __folio_alloc_noprof+0x14/0xc0 mm/page_alloc.c:5003 __folio_alloc_node_noprof include/linux/gfp.h:295 [inline] folio_alloc_noprof include/linux/gfp.h:330 [inline] filemap_alloc_folio_noprof include/linux/pagemap.h:653 [inline] ractl_alloc_folio mm/readahead.c:186 [inline] page_cache_ra_unbounded+0x2d8/0x670 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+0x3b3/0x990 mm/readahead.c:575 filemap_get_pages+0x427/0x17b0 mm/filemap.c:2602 filemap_read+0x3b2/0xf70 mm/filemap.c:2711 blkdev_read_iter+0x313/0x450 block/fops.c:833 new_sync_read fs/read_write.c:491 [inline] vfs_read+0x4f8/0xb30 fs/read_write.c:572 ksys_read+0x13e/0x250 fs/read_write.c:715 __do_sys_read fs/read_write.c:724 [inline] __se_sys_read fs/read_write.c:722 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:722 x64_sys_call+0x2d1a/0x2f60 arch/x86/include/generated/asm/syscalls_64.h:1 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x5e/0x160 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e page last free pid 325 tgid 325 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0xadc/0xb80 mm/page_alloc.c:2706 ___free_pages+0x61/0xf0 mm/page_alloc.c:5061 __free_pages+0xb/0x20 mm/page_alloc.c:5071 vfree+0x321/0x4c0 mm/vmalloc.c:3434 delayed_vfree_work+0x55/0x80 mm/vmalloc.c:3353 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0x7c7/0x1020 kernel/workqueue.c:3321 worker_thread+0x99b/0xdc0 kernel/workqueue.c:3402 kthread+0x6e9/0x860 kernel/kthread.c:464 ret_from_fork+0x136/0x1e0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff8881364dcf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881364dcf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881364dd000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881364dd080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881364dd100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop4): ext4_dx_csum_set:499: inode #2: comm syz.4.95: dir seems corrupt? Run e2fsck -D.