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+0x1328/0x1b10 fs/ocfs2/dir.c:1925 Read of size 2 at addr ffff88805b5128c9 by task syz.0.21/6664 CPU: 0 UID: 0 PID: 6664 Comm: syz.0.21 Not tainted 6.14.0-rc7-syzkaller-00205-g586de92313fc #0 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+0x23d/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16a/0x5b0 mm/kasan/report.c:521 kasan_report+0x13f/0x180 mm/kasan/report.c:634 ocfs2_dir_foreach_blk_id fs/ocfs2/dir.c:1787 [inline] ocfs2_dir_foreach_blk+0x1328/0x1b10 fs/ocfs2/dir.c:1925 ocfs2_readdir+0x29d/0x5d0 fs/ocfs2/dir.c:1969 wrap_directory_iterator+0x8d/0xd0 fs/readdir.c:65 iterate_dir+0x5a5/0x760 fs/readdir.c:108 __do_sys_getdents fs/readdir.c:322 [inline] __se_sys_getdents+0x1f9/0x4e0 fs/readdir.c:308 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x7e/0x180 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f7a2ad8cda9 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:00007f7a2bbe9038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007f7a2afa5fa0 RCX: 00007f7a2ad8cda9 RDX: 0000000000000054 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f7a2ae0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f7a2afa5fa0 R15: 00007ffcfe6fbdf8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x7f7a21a04 pfn:0x5b512 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 00000007f7a21a04 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_COMP|__GFP_ZERO), pid 6664, tgid 6663 (syz.0.21), ts 133721827565, free_ts 133908855914 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1e0/0x220 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x35e2/0x3720 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x252/0x680 mm/page_alloc.c:4740 alloc_pages_mpol+0x30d/0x660 mm/mempolicy.c:2270 folio_alloc_mpol_noprof mm/mempolicy.c:2289 [inline] vma_alloc_folio_noprof+0x127/0x250 mm/mempolicy.c:2324 folio_prealloc+0x2e/0x160 alloc_anon_folio mm/memory.c:4834 [inline] do_anonymous_page mm/memory.c:4891 [inline] do_pte_missing mm/memory.c:4057 [inline] handle_pte_fault mm/memory.c:5888 [inline] __handle_mm_fault+0x350f/0x7000 mm/memory.c:6031 handle_mm_fault+0x371/0x720 mm/memory.c:6200 do_user_addr_fault arch/x86/mm/fault.c:1337 [inline] handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x3e8/0x7e0 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 6664 tgid 6663 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe16/0x1860 mm/page_alloc.c:2707 folios_put_refs+0x764/0x860 mm/swap.c:994 folios_put include/linux/mm.h:1551 [inline] folio_batch_move_lru+0x392/0x420 mm/swap.c:175 __folio_batch_add_and_move+0x5b7/0xd60 mm/swap.c:196 filemap_add_folio+0x24a/0x370 mm/filemap.c:996 __filemap_get_folio+0x520/0xb30 mm/filemap.c:1979 grow_dev_folio fs/buffer.c:1039 [inline] grow_buffers fs/buffer.c:1105 [inline] __getblk_slow fs/buffer.c:1131 [inline] bdev_getblk+0x1d0/0x670 fs/buffer.c:1431 __getblk include/linux/buffer_head.h:380 [inline] sb_getblk include/linux/buffer_head.h:386 [inline] ocfs2_read_blocks+0x4fd/0x15d0 fs/ocfs2/buffer_head_io.c:236 ocfs2_map_slot_buffers fs/ocfs2/slot_map.c:385 [inline] ocfs2_init_slot_info+0xb2f/0x13b0 fs/ocfs2/slot_map.c:424 ocfs2_initialize_super fs/ocfs2/super.c:2217 [inline] ocfs2_fill_super+0x4cb0/0x71f0 fs/ocfs2/super.c:993 get_tree_bdev_flags+0x488/0x5c0 fs/super.c:1636 vfs_get_tree+0x8c/0x280 fs/super.c:1814 do_new_mount+0x2ba/0xb40 fs/namespace.c:3560 do_mount fs/namespace.c:3900 [inline] __do_sys_mount fs/namespace.c:4111 [inline] __se_sys_mount+0x2d2/0x3c0 fs/namespace.c:4088 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x7e/0x180 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e Memory state around the buggy address: ffff88805b512780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805b512800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805b512880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805b512900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805b512980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================