ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode. ================================================================== BUG: KASAN: use-after-free in ocfs2_dir_foreach_blk_id fs/ocfs2/dir.c:1787 [inline] BUG: KASAN: use-after-free in ocfs2_dir_foreach_blk+0x1344/0x1b30 fs/ocfs2/dir.c:1925 Read of size 2 at addr ffff888057dec197 by task syz.0.16/6481 CPU: 1 UID: 0 PID: 6481 Comm: syz.0.16 Not tainted 6.15.0-rc1-syzkaller-00301-g3bde70a2c827 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 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:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 ocfs2_dir_foreach_blk_id fs/ocfs2/dir.c:1787 [inline] ocfs2_dir_foreach_blk+0x1344/0x1b30 fs/ocfs2/dir.c:1925 ocfs2_readdir+0x2b1/0x5e0 fs/ocfs2/dir.c:1969 wrap_directory_iterator+0x91/0xd0 fs/readdir.c:65 iterate_dir+0x5a9/0x760 fs/readdir.c:108 __do_sys_getdents fs/readdir.c:322 [inline] __se_sys_getdents+0x1ff/0x4e0 fs/readdir.c:308 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2f3678cda9 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:00007f2f375fb038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007f2f369a5fa0 RCX: 00007f2f3678cda9 RDX: 0000000000000054 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f2f3680e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f2f369a5fa0 R15: 00007fff5363e268 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x23 pfn:0x57dec flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00015f7b48 ffffea00015f7a48 0000000000000000 raw: 0000000000000023 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 6504, tgid 6504 (sed), ts 133749596444, free_ts 133760977608 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1717 prep_new_page mm/page_alloc.c:1725 [inline] get_page_from_freelist+0x351d/0x36b0 mm/page_alloc.c:3652 __alloc_frozen_pages_noprof+0x211/0x5b0 mm/page_alloc.c:4934 alloc_pages_mpol+0x339/0x690 mm/mempolicy.c:2301 folio_alloc_mpol_noprof mm/mempolicy.c:2320 [inline] vma_alloc_folio_noprof+0x12d/0x260 mm/mempolicy.c:2355 folio_prealloc+0x2e/0x170 mm/memory.c:-1 do_cow_fault mm/memory.c:5542 [inline] do_fault mm/memory.c:5654 [inline] do_pte_missing mm/memory.c:4160 [inline] handle_pte_fault+0xc70/0x61c0 mm/memory.c:5997 __handle_mm_fault mm/memory.c:6140 [inline] handle_mm_fault+0x1030/0x1aa0 mm/memory.c:6309 do_user_addr_fault arch/x86/mm/fault.c:1337 [inline] handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x45b/0x920 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 6504 tgid 6504 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] free_unref_folios+0xdfd/0x17e0 mm/page_alloc.c:2737 folios_put_refs+0x70a/0x800 mm/swap.c:992 free_pages_and_swap_cache+0x2ea/0x6a0 mm/swap_state.c:267 __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:397 [inline] tlb_flush_mmu+0x3a9/0x690 mm/mmu_gather.c:404 tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:496 exit_mmap+0x5b1/0xde0 mm/mmap.c:1297 __mmput+0x115/0x410 kernel/fork.c:1379 exit_mm+0x221/0x310 kernel/exit.c:589 do_exit+0x994/0x27f0 kernel/exit.c:940 do_group_exit+0x207/0x2c0 kernel/exit.c:1102 __do_sys_exit_group kernel/exit.c:1113 [inline] __se_sys_exit_group kernel/exit.c:1111 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1111 x64_sys_call+0x26c3/0x26d0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888057dec080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888057dec100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888057dec180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888057dec200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888057dec280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================