EXT4-fs warning (device loop0): dx_probe:833: inode #2: comm syz.0.16: Unrecognised inode hash code 4 EXT4-fs warning (device loop0): dx_probe:966: inode #2: comm syz.0.16: Corrupt directory, running e2fsck is recommended ================================================================== BUG: KASAN: use-after-free in __ext4_check_dir_entry+0x6fd/0x880 fs/ext4/dir.c:85 Read of size 2 at addr ffff88805923e003 by task syz.0.16/6633 CPU: 1 UID: 0 PID: 6633 Comm: syz.0.16 Not tainted 6.13.0-rc4-syzkaller-00071-gfd0584d220fe #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 __ext4_check_dir_entry+0x6fd/0x880 fs/ext4/dir.c:85 ext4_readdir+0x1436/0x3a60 fs/ext4/dir.c:259 iterate_dir+0x571/0x800 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64+0x1e2/0x4b0 fs/readdir.c:389 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5b2337dff9 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:00007f5b240d2038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f5b23535f80 RCX: 00007f5b2337dff9 RDX: 0000000000000010 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007f5b233f0296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f5b23535f80 R15: 00007ffe9256f458 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88805923ecb0 pfn:0x5923e flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000a19788 ffffea0000925048 0000000000000000 raw: ffff88805923ecb0 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_COMP|__GFP_ZERO), pid 6599, tgid 6599 (modprobe), ts 111345902323, free_ts 111369899550 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2269 pagetable_alloc_noprof include/linux/mm.h:2899 [inline] __pud_alloc_one_noprof include/asm-generic/pgalloc.h:174 [inline] pud_alloc_one_noprof include/asm-generic/pgalloc.h:195 [inline] __pud_alloc+0x96/0x4e0 mm/memory.c:6341 pud_alloc include/linux/mm.h:2856 [inline] __handle_mm_fault mm/memory.c:5873 [inline] handle_mm_fault+0x184f/0x1ad0 mm/memory.c:6112 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x2b9/0x8b0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 6599 tgid 6599 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe23/0x1890 mm/page_alloc.c:2706 folios_put_refs+0x76c/0x860 mm/swap.c:962 free_pages_and_swap_cache+0x5c8/0x690 mm/swap_state.c:335 __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+0x496/0xc20 mm/mmap.c:1681 __mmput+0x115/0x3b0 kernel/fork.c:1348 exit_mm+0x220/0x310 kernel/exit.c:570 do_exit+0x9ad/0x28e0 kernel/exit.c:925 do_group_exit+0x207/0x2c0 kernel/exit.c:1087 __do_sys_exit_group kernel/exit.c:1098 [inline] __se_sys_exit_group kernel/exit.c:1096 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1096 x64_sys_call+0x26a8/0x26b0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805923df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805923df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805923e000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805923e080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805923e100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================