================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff88811b9d8535 by task syz-executor/477 CPU: 0 PID: 477 Comm: syz-executor Not tainted 6.1.128-syzkaller-1167804-g9bcabbda673a #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/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:348 ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1246 ext4_dx_readdir fs/ext4/dir.c:605 [inline] ext4_readdir+0x2e6f/0x3860 fs/ext4/dir.c:142 iterate_dir+0x265/0x600 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x1c1/0x460 fs/readdir.c:354 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354 x64_sys_call+0x5ae/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:218 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7ff8809bfad3 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 72 3e f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8 RSP: 002b:00007ffcc5d01f28 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555577d5e4e0 RCX: 00007ff8809bfad3 RDX: 0000000000008000 RSI: 0000555577d5e4e0 RDI: 0000000000000005 RBP: 0000555577d5e4b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007ff880b7cca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 0000555577d5e4b0 R15: 00007ffcc5d041e0 Allocated by task 136: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:333 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:768 slab_alloc_node mm/slub.c:3421 [inline] slab_alloc mm/slub.c:3431 [inline] __kmem_cache_alloc_lru mm/slub.c:3438 [inline] kmem_cache_alloc+0x175/0x320 mm/slub.c:3447 vm_area_alloc+0x24/0x1b0 kernel/fork.c:495 __mmap_region mm/mmap.c:2837 [inline] mmap_region+0xbfd/0x2c40 mm/mmap.c:3005 do_mmap+0x853/0xe30 mm/mmap.c:1474 vm_mmap_pgoff+0x208/0x430 mm/util.c:525 ksys_mmap_pgoff+0x15d/0x1e0 mm/mmap.c:1520 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:93 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __x64_sys_mmap+0x103/0x120 arch/x86/kernel/sys_x86_64.c:86 x64_sys_call+0x67/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:10 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 136: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook mm/slub.c:1771 [inline] slab_free mm/slub.c:3686 [inline] kmem_cache_free+0x291/0x560 mm/slub.c:3711 __vm_area_free+0x83/0x130 kernel/fork.c:536 remove_vma mm/mmap.c:148 [inline] exit_mmap+0x549/0xbb0 mm/mmap.c:3369 __mmput+0x95/0x310 kernel/fork.c:1299 mmput+0x56/0x170 kernel/fork.c:1322 exit_mm kernel/exit.c:568 [inline] do_exit+0xb24/0x2b80 kernel/exit.c:864 do_group_exit+0x21a/0x2d0 kernel/exit.c:1027 __do_sys_exit_group kernel/exit.c:1038 [inline] __se_sys_exit_group kernel/exit.c:1036 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036 x64_sys_call+0x610/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88811b9d8528 which belongs to the cache vm_area_struct of size 200 The buggy address is located 13 bytes inside of 200-byte region [ffff88811b9d8528, ffff88811b9d85f0) The buggy address belongs to the physical page: page:ffffea00046e7600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11b9d8 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881002a8780 raw: 0000000000000000 00000000000f000f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 136, tgid 136 (S41dhcpcd), ts 6336345840, free_ts 6334922444 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2637 prep_new_page+0x1b/0x110 mm/page_alloc.c:2644 get_page_from_freelist+0x3a98/0x3b10 mm/page_alloc.c:4539 __alloc_pages+0x234/0x610 mm/page_alloc.c:5837 alloc_slab_page+0x6c/0xf0 allocate_slab mm/slub.c:1962 [inline] new_slab+0x90/0x3e0 mm/slub.c:2015 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203 __slab_alloc+0x5d/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] slab_alloc mm/slub.c:3431 [inline] __kmem_cache_alloc_lru mm/slub.c:3438 [inline] kmem_cache_alloc+0x1be/0x320 mm/slub.c:3447 vm_area_dup+0x27/0x290 kernel/fork.c:510 __split_vma+0x1bd/0x800 mm/mmap.c:2423 do_mas_align_munmap+0x870/0x13a0 mm/mmap.c:2563 do_mas_munmap+0x23e/0x2b0 mm/mmap.c:2726 __mmap_region mm/mmap.c:2774 [inline] mmap_region+0x941/0x2c40 mm/mmap.c:3005 do_mmap+0x853/0xe30 mm/mmap.c:1474 vm_mmap_pgoff+0x208/0x430 mm/util.c:525 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1545 [inline] free_pcp_prepare mm/page_alloc.c:1619 [inline] free_unref_page_prepare+0x9f1/0xa00 mm/page_alloc.c:3581 free_unref_page_list+0xf1/0x7b0 mm/page_alloc.c:3729 release_pages+0xef9/0xf50 mm/swap.c:1043 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:315 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu mm/mmu_gather.c:261 [inline] tlb_finish_mmu+0x1e0/0x3f0 mm/mmu_gather.c:361 exit_mmap+0x45b/0xbb0 mm/mmap.c:3359 __mmput+0x95/0x310 kernel/fork.c:1299 mmput+0x56/0x170 kernel/fork.c:1322 exec_mmap+0x417/0x4a0 fs/exec.c:1041 begin_new_exec+0xa59/0x1ce0 fs/exec.c:1301 load_elf_binary+0x95e/0x2680 fs/binfmt_elf.c:1002 search_binary_handler fs/exec.c:1743 [inline] exec_binprm fs/exec.c:1784 [inline] bprm_execve+0x731/0x1480 fs/exec.c:1853 do_execveat_common+0x90a/0xab0 fs/exec.c:1958 do_execve fs/exec.c:2032 [inline] __do_sys_execve fs/exec.c:2108 [inline] __se_sys_execve fs/exec.c:2103 [inline] __x64_sys_execve+0x92/0xb0 fs/exec.c:2103 x64_sys_call+0x1c5/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:60 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 Memory state around the buggy address: ffff88811b9d8400: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb ffff88811b9d8480: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc >ffff88811b9d8500: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb ^ ffff88811b9d8580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff88811b9d8600: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs (loop2): unmounting filesystem.