================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1543 Read of size 1 at addr ffff88811f635d23 by task syz-executor.0/363 CPU: 0 PID: 363 Comm: syz-executor.0 Not tainted 5.15.161-syzkaller-1074764-g8e36931104ac #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/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/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1543 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1714 __ext4_find_entry+0x2b0/0x1af0 fs/ext4/namei.c:1616 ext4_lookup_entry fs/ext4/namei.c:1771 [inline] ext4_lookup+0x3c6/0xaa0 fs/ext4/namei.c:1839 lookup_one_qstr_excl+0x143/0x290 fs/namei.c:1563 filename_create+0x28e/0x530 fs/namei.c:3836 do_mkdirat+0xbd/0x450 fs/namei.c:4080 __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4103 x64_sys_call+0x6c6/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259 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:0x7f1e9505bae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1e94bde0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f1e9517af80 RCX: 00007f1e9505bae9 RDX: 0000000000000000 RSI: 0000000020000040 RDI: ffffffffffffff9c RBP: 00007f1e950a747a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f1e9517af80 R15: 00007ffecf453af8 The buggy address belongs to the page: page:ffffea00047d8d40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11f635 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea00047d9248 ffffea00047d8d08 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 294, ts 28092309153, free_ts 29247266058 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 __alloc_pages_node include/linux/gfp.h:591 [inline] alloc_pages_node include/linux/gfp.h:605 [inline] alloc_pages include/linux/gfp.h:618 [inline] wp_page_copy+0x1d4/0x1b00 mm/memory.c:3189 do_wp_page+0x9ca/0xc90 handle_pte_fault+0x799/0x25c0 mm/memory.c:4898 do_handle_mm_fault+0x20bc/0x2400 mm/memory.c:5299 do_user_addr_fault arch/x86/mm/fault.c:1325 [inline] handle_page_fault arch/x86/mm/fault.c:1509 [inline] exc_page_fault+0x26f/0x7f0 arch/x86/mm/fault.c:1565 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:568 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page_list+0x14b/0xa60 mm/page_alloc.c:3671 release_pages+0x1310/0x1370 mm/swap.c:1009 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:320 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu+0xd0/0x180 mm/mmu_gather.c:247 zap_pte_range mm/memory.c:1513 [inline] zap_pmd_range mm/memory.c:1562 [inline] zap_pud_range mm/memory.c:1591 [inline] zap_p4d_range mm/memory.c:1612 [inline] unmap_page_range+0x1c70/0x1ed0 mm/memory.c:1633 unmap_single_vma mm/memory.c:1678 [inline] unmap_vmas+0x389/0x560 mm/memory.c:1710 exit_mmap+0x3e4/0x940 mm/mmap.c:3215 __mmput+0x95/0x310 kernel/fork.c:1179 mmput+0x5b/0x170 kernel/fork.c:1202 exit_mm kernel/exit.c:552 [inline] do_exit+0xb9c/0x2ca0 kernel/exit.c:865 do_group_exit+0x141/0x310 kernel/exit.c:1000 __do_sys_exit_group kernel/exit.c:1011 [inline] __se_sys_exit_group kernel/exit.c:1009 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1009 x64_sys_call+0x610/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 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 Memory state around the buggy address: ffff88811f635c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811f635c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88811f635d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811f635d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811f635e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop0): ext4_find_dest_de:2112: inode #12: block 7: comm syz-executor.0: bad entry in directory: rec_len % 4 != 0 - offset=0, inode=3089191003, rec_len=43069, size=56 fake=0