ocfs2: Mounting device (7,3) on (node local, slot 0) with ordered data mode. ================================================================== BUG: KASAN: use-after-free in ocfs2_find_smallest_chain fs/ocfs2/suballoc.c:413 [inline] BUG: KASAN: use-after-free in ocfs2_block_group_alloc_contig fs/ocfs2/suballoc.c:430 [inline] BUG: KASAN: use-after-free in ocfs2_block_group_alloc fs/ocfs2/suballoc.c:699 [inline] BUG: KASAN: use-after-free in ocfs2_reserve_suballoc_bits+0x1020/0x4e70 fs/ocfs2/suballoc.c:832 Read of size 4 at addr ffff88805f07a004 by task syz.3.21/6096 CPU: 1 UID: 0 PID: 6096 Comm: syz.3.21 Not tainted 6.14.0-rc3-syzkaller-00012-g2408a807bfc3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/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 ocfs2_find_smallest_chain fs/ocfs2/suballoc.c:413 [inline] ocfs2_block_group_alloc_contig fs/ocfs2/suballoc.c:430 [inline] ocfs2_block_group_alloc fs/ocfs2/suballoc.c:699 [inline] ocfs2_reserve_suballoc_bits+0x1020/0x4e70 fs/ocfs2/suballoc.c:832 ocfs2_reserve_new_metadata_blocks+0x41c/0x9c0 fs/ocfs2/suballoc.c:982 ocfs2_mknod+0x143a/0x2b30 fs/ocfs2/namei.c:347 ocfs2_create+0x1ab/0x470 fs/ocfs2/namei.c:673 lookup_open fs/namei.c:3651 [inline] open_last_lookups fs/namei.c:3750 [inline] path_openat+0x193c/0x3590 fs/namei.c:3986 do_filp_open+0x27f/0x4e0 fs/namei.c:4016 do_sys_openat2+0x13e/0x1d0 fs/open.c:1428 do_sys_open fs/open.c:1443 [inline] __do_sys_openat fs/open.c:1459 [inline] __se_sys_openat fs/open.c:1454 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1454 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:0x7faac298cde9 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:00007faac3707038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007faac2ba5fa0 RCX: 00007faac298cde9 RDX: 0000000000000042 RSI: 00004000000002c0 RDI: ffffffffffffff9c RBP: 00007faac2a0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007faac2ba5fa0 R15: 00007ffd69714f08 The buggy address belongs to the physical page: page: refcount:2 mapcount:0 mapping:ffff8880552e5f10 index:0x21 pfn:0x5f07a memcg:ffff888140adc000 aops:shmem_aops ino:3 dentry name(?):"messages" flags: 0xfff0000002011c(referenced|uptodate|dirty|active|swapbacked|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff0000002011c 0000000000000000 dead000000000122 ffff8880552e5f10 raw: 0000000000000021 0000000000000000 00000002ffffffff ffff888140adc000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5178, tgid 5178 (syslogd), ts 83038316323, free_ts 82903491343 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4739 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 folio_alloc_mpol_noprof+0x36/0x70 mm/mempolicy.c:2289 shmem_alloc_folio mm/shmem.c:1863 [inline] shmem_alloc_and_add_folio+0x4a0/0x1090 mm/shmem.c:1902 shmem_get_folio_gfp+0x621/0x1840 mm/shmem.c:2522 shmem_get_folio mm/shmem.c:2628 [inline] shmem_write_begin+0x165/0x350 mm/shmem.c:3278 generic_perform_write+0x346/0x990 mm/filemap.c:4189 shmem_file_write_iter+0xf9/0x120 mm/shmem.c:3454 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xacf/0xd10 fs/read_write.c:679 ksys_write+0x18f/0x2b0 fs/read_write.c:731 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 page last free pid 6096 tgid 6095 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe2f/0x18a0 mm/page_alloc.c:2707 folios_put_refs+0x76c/0x860 mm/swap.c:994 free_pages_and_swap_cache+0x5c3/0x690 mm/swap_state.c:334 __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:389 [inline] tlb_flush_mmu+0x3a3/0x680 mm/mmu_gather.c:396 tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:488 vms_clear_ptes+0x432/0x530 mm/vma.c:1144 vms_complete_munmap_vmas+0x210/0x8f0 mm/vma.c:1186 do_vmi_align_munmap+0x5ef/0x6f0 mm/vma.c:1445 do_vmi_munmap+0x24e/0x2d0 mm/vma.c:1493 __vm_munmap+0x372/0x510 mm/vma.c:2951 __do_sys_munmap mm/mmap.c:1084 [inline] __se_sys_munmap mm/mmap.c:1081 [inline] __x64_sys_munmap+0x60/0x70 mm/mmap.c:1081 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: ffff88805f079f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805f079f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805f07a000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88805f07a080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805f07a100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================