================================================================== BUG: KASAN: use-after-free in __ext4_check_dir_entry+0x6fb/0x880 fs/ext4/dir.c:85 Read of size 2 at addr ffff888067c9f003 by task syz-executor.3/6113 CPU: 0 PID: 6113 Comm: syz-executor.3 Not tainted 6.10.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 __ext4_check_dir_entry+0x6fb/0x880 fs/ext4/dir.c:85 ext4_readdir+0x1335/0x3e10 fs/ext4/dir.c:258 iterate_dir+0x65e/0x820 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:409 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:394 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x82/0x160 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7feffdc7cee9 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:00007feffea3c0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007feffddb3fa0 RCX: 00007feffdc7cee9 RDX: 0000000000000010 RSI: 0000000000000000 RDI: 0000000000000008 RBP: 00007feffdcc947f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007feffddb3fa0 R15: 00007ffc5188eac8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x1a2 pfn:0x67c9f flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001bfd348 ffffea0001c80408 0000000000000000 raw: 00000000000001a2 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 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 6120, tgid 6120 (sed), ts 97960432379, free_ts 98018745771 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1ee/0x220 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x2df3/0x2eb0 mm/page_alloc.c:3402 __alloc_pages_noprof+0x256/0x6b0 mm/page_alloc.c:4660 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 vma_alloc_folio_noprof+0xf3/0x1f0 mm/mempolicy.c:2304 folio_prealloc+0x31/0x170 do_cow_fault mm/memory.c:4950 [inline] do_fault mm/memory.c:5058 [inline] do_pte_missing+0x636/0x44c0 mm/memory.c:3903 handle_pte_fault mm/memory.c:5380 [inline] __handle_mm_fault mm/memory.c:5523 [inline] handle_mm_fault+0x1f7b/0x4710 mm/memory.c:5688 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x408/0x810 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 6120 tgid 6120 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_folios+0xf07/0x1990 mm/page_alloc.c:2614 folios_put_refs+0x93a/0xa60 mm/swap.c:1024 free_pages_and_swap_cache+0x2ea/0x690 mm/swap_state.c:329 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu+0x3a3/0x680 mm/mmu_gather.c:373 tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:465 exit_mmap+0x4e6/0xd10 mm/mmap.c:3354 __mmput+0x115/0x3c0 kernel/fork.c:1346 exit_mm+0x220/0x310 kernel/exit.c:565 do_exit+0x9aa/0x27e0 kernel/exit.c:861 do_group_exit+0x207/0x2c0 kernel/exit.c:1023 __do_sys_exit_group kernel/exit.c:1034 [inline] __se_sys_exit_group kernel/exit.c:1032 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1032 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x82/0x160 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e Memory state around the buggy address: ffff888067c9ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888067c9ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888067c9f000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888067c9f080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888067c9f100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================