================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1543 Read of size 1 at addr ffff888124b2fd23 by task syz-executor.0/357 CPU: 0 PID: 357 Comm: syz-executor.0 Not tainted 6.6.0-rc6-syzkaller-00355-gfe3cfe869d5e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x15d/0x540 mm/kasan/report.c:475 kasan_report+0x17c/0x1c0 mm/kasan/report.c:588 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:378 ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1543 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1694 __ext4_find_entry+0x2b0/0x1af0 fs/ext4/namei.c:1616 ext4_lookup_entry fs/ext4/namei.c:1771 [inline] ext4_lookup+0x176/0x740 fs/ext4/namei.c:1839 lookup_open fs/namei.c:3474 [inline] open_last_lookups fs/namei.c:3564 [inline] path_openat+0x124f/0x30b0 fs/namei.c:3794 do_filp_open+0x230/0x480 fs/namei.c:3824 do_sys_openat2+0x13a/0x1c0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_creat fs/open.c:1513 [inline] __se_sys_creat fs/open.c:1507 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1507 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f44c347cae9 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:00007f44c413c0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f44c359bf80 RCX: 00007f44c347cae9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000e00 RBP: 00007f44c34c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f44c359bf80 R15: 00007fff38c98468 The buggy address belongs to the physical page: page:ffffea000492cbc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x124b2f flags: 0x4000000000000000(zone=1) page_type: 0xffffffff() raw: 4000000000000000 ffffea000492cc08 ffffea000492cb88 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 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), pid 357, tgid 356 (syz-executor.0), ts 45834731580, free_ts 45850796514 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x3445/0x3510 mm/page_alloc.c:3170 __alloc_pages+0x3c2/0x7d0 mm/page_alloc.c:4426 __folio_alloc+0x15/0x40 mm/page_alloc.c:4458 __folio_alloc_node include/linux/gfp.h:246 [inline] folio_alloc include/linux/gfp.h:275 [inline] do_anonymous_page mm/memory.c:4110 [inline] do_pte_missing+0xa5d/0x2ed0 mm/memory.c:3667 handle_pte_fault mm/memory.c:4978 [inline] __handle_mm_fault mm/memory.c:5119 [inline] handle_mm_fault+0x146c/0x1db0 mm/memory.c:5284 do_user_addr_fault arch/x86/mm/fault.c:1364 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x426/0x740 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:570 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x468/0x6b0 mm/page_alloc.c:2312 free_unref_page_list+0xf7/0x780 mm/page_alloc.c:2451 release_pages+0xf2e/0xf90 mm/swap.c:1042 free_pages_and_swap_cache+0x8e/0xa0 mm/swap_state.c:315 tlb_batch_pages_flush mm/mmu_gather.c:98 [inline] tlb_flush_mmu_free mm/mmu_gather.c:293 [inline] tlb_flush_mmu+0x371/0x4d0 mm/mmu_gather.c:300 tlb_finish_mmu+0xd7/0x1f0 mm/mmu_gather.c:392 unmap_region+0x2fc/0x350 mm/mmap.c:2318 do_vmi_align_munmap+0xaec/0x10b0 mm/mmap.c:2555 do_vmi_munmap+0x23e/0x2c0 mm/mmap.c:2623 __vm_munmap+0x230/0x350 mm/mmap.c:2908 __do_sys_munmap mm/mmap.c:2925 [inline] __se_sys_munmap mm/mmap.c:2922 [inline] __x64_sys_munmap+0x60/0x70 mm/mmap.c:2922 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888124b2fc00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888124b2fc80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888124b2fd00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888124b2fd80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888124b2fe00: 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