EXT4-fs warning (device loop0): dx_probe:832: inode #2: comm syz-executor.0: Unrecognised inode hash code 49 EXT4-fs warning (device loop0): dx_probe:965: inode #2: comm syz-executor.0: Corrupt directory, running e2fsck is recommended ================================================================== BUG: KASAN: use-after-free in __ext4_check_dir_entry+0x704/0x880 fs/ext4/dir.c:85 Read of size 2 at addr ffff888125c80003 by task syz-executor.0/361 CPU: 1 PID: 361 Comm: syz-executor.0 Not tainted 6.9.0-rc7-syzkaller-00183-gcf87f46fd34d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x184/0x200 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x163/0x550 mm/kasan/report.c:488 kasan_report+0x15f/0x190 mm/kasan/report.c:601 __asan_report_load2_noabort+0x14/0x20 mm/kasan/report_generic.c:379 __ext4_check_dir_entry+0x704/0x880 fs/ext4/dir.c:85 ext4_readdir+0x143e/0x37e0 fs/ext4/dir.c:258 iterate_dir+0x1f2/0x590 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:409 [inline] __se_sys_getdents64+0x1c1/0x470 fs/readdir.c:394 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:394 x64_sys_call+0x2916/0x2cd0 arch/x86/include/generated/asm/syscalls_64.h:218 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x54/0x120 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f892b67dd69 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:00007f892c44a0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f892b7abf80 RCX: 00007f892b67dd69 RDX: 0000000000000010 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007f892b6ca49e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f892b7abf80 R15: 00007ffdb3abe138 The buggy address belongs to the physical page: page: refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x125c80 flags: 0x4000000000000000(zone=1) page_type: 0xffffff7f(buddy) raw: 4000000000000000 ffffffff870b5868 ffffffff870b5868 0000000000000000 raw: 0000000000000001 0000000000000007 00000000ffffff7f 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 291, tgid 284 (syz-fuzzer), ts 25046027087, free_ts 25435712680 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x217/0x220 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x3587/0x3650 mm/page_alloc.c:3317 __alloc_pages+0x3ad/0x800 mm/page_alloc.c:4575 __folio_alloc+0x10/0x30 mm/page_alloc.c:4607 alloc_anon_folio mm/memory.c:4375 [inline] do_anonymous_page mm/memory.c:4433 [inline] do_pte_missing+0x1c43/0x3d30 mm/memory.c:3878 handle_pte_fault mm/memory.c:5300 [inline] __handle_mm_fault mm/memory.c:5441 [inline] handle_mm_fault+0x155b/0x2170 mm/memory.c:5606 do_user_addr_fault arch/x86/mm/fault.c:1331 [inline] handle_page_fault arch/x86/mm/fault.c:1474 [inline] exc_page_fault+0x419/0x720 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 290 tgid 284 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x4b1/0x6e0 mm/page_alloc.c:2347 free_unref_folios+0x15c/0x8b0 mm/page_alloc.c:2536 folios_put_refs+0x696/0x7b0 mm/swap.c:1034 free_pages_and_swap_cache+0x2e2/0x620 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+0x431/0x6f0 mm/mmu_gather.c:373 zap_pte_range mm/memory.c:1683 [inline] zap_pmd_range mm/memory.c:1722 [inline] zap_pud_range mm/memory.c:1751 [inline] zap_p4d_range mm/memory.c:1772 [inline] unmap_page_range+0x406f/0x4680 mm/memory.c:1793 unmap_single_vma mm/memory.c:1839 [inline] unmap_vmas+0x376/0x4f0 mm/memory.c:1883 exit_mmap+0x2ea/0xb40 mm/mmap.c:3267 __mmput+0x95/0x310 kernel/fork.c:1346 mmput+0x5a/0x70 kernel/fork.c:1368 exit_mm kernel/exit.c:569 [inline] do_exit+0xa98/0x29d0 kernel/exit.c:865 do_group_exit+0x21b/0x2d0 kernel/exit.c:1027 get_signal+0x161e/0x1760 kernel/signal.c:2911 arch_do_signal_or_restart+0x92/0x7d0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x52/0x120 kernel/entry/common.c:218 do_syscall_64+0x60/0x120 arch/x86/entry/common.c:89 Memory state around the buggy address: ffff888125c7ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888125c7ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888125c80000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888125c80080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888125c80100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop0): ext4_readdir:260: inode #2: block 255: comm syz-executor.0: path /root/syzkaller-testdir3945578976/syzkaller.GYWf6G/1/file0: bad entry in directory: directory entry overrun - offset=1023, inode=811808768, rec_len=25632, size=1024 fake=0