loop0: detected capacity change from 0 to 32768 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+0x1149/0x18a0 fs/ocfs2/dir.c:1925 Read of size 2 at addr ffff88805b26c8c9 by task syz.0.18/6620 CPU: 0 UID: 0 PID: 6620 Comm: syz.0.18 Not tainted 6.15.0-rc3-syzkaller-00283-gf1a3944c860b #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 ocfs2_dir_foreach_blk_id fs/ocfs2/dir.c:1787 [inline] ocfs2_dir_foreach_blk+0x1149/0x18a0 fs/ocfs2/dir.c:1925 ocfs2_readdir+0x254/0x4c0 fs/ocfs2/dir.c:1969 wrap_directory_iterator+0x96/0xe0 fs/readdir.c:65 iterate_dir+0x5af/0x770 fs/readdir.c:108 __do_sys_getdents fs/readdir.c:322 [inline] __se_sys_getdents+0xe4/0x250 fs/readdir.c:308 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0de318cda9 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:00007f0de402d038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007f0de33a5fa0 RCX: 00007f0de318cda9 RDX: 0000000000000054 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f0de320e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f0de33a5fa0 R15: 00007ffe8a6733c8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x5557e2ebb pfn:0x5b26c flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00016c9ac8 ffffea00016c9b48 0000000000000000 raw: 00000005557e2ebb 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_ZERO|__GFP_COMP), pid 6630, tgid 6630 (sed), ts 152493263556, free_ts 152500789178 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x21ce/0x22b0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 folio_alloc_mpol_noprof mm/mempolicy.c:2320 [inline] vma_alloc_folio_noprof+0xe4/0x200 mm/mempolicy.c:2355 folio_prealloc+0x30/0x180 mm/memory.c:-1 alloc_anon_folio mm/memory.c:4943 [inline] do_anonymous_page mm/memory.c:5000 [inline] do_pte_missing mm/memory.c:4158 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x2b28/0x5380 mm/memory.c:6140 handle_mm_fault+0x3f6/0x8c0 mm/memory.c:6309 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1337 handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x68/0x110 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 6629 tgid 6629 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] free_unref_folios+0xb81/0x14a0 mm/page_alloc.c:2782 folios_put_refs+0x559/0x640 mm/swap.c:992 folios_put include/linux/mm.h:1639 [inline] folio_batch_move_lru+0x319/0x3a0 mm/swap.c:175 __folio_batch_add_and_move+0x5ad/0xd20 mm/swap.c:196 wp_page_copy mm/memory.c:3546 [inline] do_wp_page+0x1ba5/0x5760 mm/memory.c:3939 handle_pte_fault mm/memory.c:6013 [inline] __handle_mm_fault+0x1028/0x5380 mm/memory.c:6140 handle_mm_fault+0x3f6/0x8c0 mm/memory.c:6309 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1337 handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x68/0x110 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 Memory state around the buggy address: ffff88805b26c780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805b26c800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805b26c880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805b26c900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805b26c980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================