================================================================== BUG: KASAN: slab-use-after-free in ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5967 [inline] BUG: KASAN: slab-use-after-free in __ocfs2_flush_truncate_log+0x7c7/0x10e0 fs/ocfs2/alloc.c:6062 Read of size 4 at addr ffff88802f4122c0 by task syz-executor/6575 CPU: 1 UID: 0 PID: 6575 Comm: syz-executor Not tainted 6.15.0-rc5-syzkaller-00300-g3ce9925823c7 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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_replay_truncate_records fs/ocfs2/alloc.c:5967 [inline] __ocfs2_flush_truncate_log+0x7c7/0x10e0 fs/ocfs2/alloc.c:6062 ocfs2_flush_truncate_log+0x4f/0x70 fs/ocfs2/alloc.c:6084 ocfs2_sync_fs+0x116/0x310 fs/ocfs2/super.c:406 sync_filesystem+0x1cc/0x230 fs/sync.c:66 generic_shutdown_super+0x6f/0x2c0 fs/super.c:621 kill_block_super+0x44/0x90 fs/super.c:1710 deactivate_locked_super+0xb9/0x130 fs/super.c:473 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1431 task_work_run+0x1d1/0x260 kernel/task_work.c:227 resume_user_mode_work+0x5e/0x80 include/linux/resume_user_mode.h:50 exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x9a/0x120 kernel/entry/common.c:218 do_syscall_64+0x103/0x210 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0e21b7fa47 Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffcc423f3e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 00007f0e21bf123c RCX: 00007f0e21b7fa47 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffcc423f4a0 RBP: 00007ffcc423f4a0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffcc4240520 R13: 00007f0e21bf123c R14: 000000000001fd28 R15: 00007ffcc4240560 Allocated by task 6667: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203 ptlock_alloc mm/memory.c:7354 [inline] ptlock_init include/linux/mm.h:3074 [inline] pmd_ptlock_init include/linux/mm.h:3201 [inline] pagetable_pmd_ctor include/linux/mm.h:3228 [inline] pmd_alloc_one_noprof include/asm-generic/pgalloc.h:140 [inline] __pmd_alloc+0xba/0x350 mm/memory.c:6647 pmd_alloc include/linux/mm.h:2965 [inline] __handle_mm_fault+0x926/0x5380 mm/memory.c:6100 handle_mm_fault+0x2d5/0x7f0 mm/memory.c:6309 do_user_addr_fault+0x764/0x1390 arch/x86/mm/fault.c:1388 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 Freed by task 24: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2380 [inline] slab_free mm/slub.c:4642 [inline] kmem_cache_free+0x192/0x3f0 mm/slub.c:4744 pagetable_dtor include/linux/mm.h:3109 [inline] pagetable_dtor_free include/linux/mm.h:3116 [inline] __tlb_remove_table+0x81/0x3b0 include/asm-generic/tlb.h:215 __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2568 [inline] rcu_core+0xca5/0x1710 kernel/rcu/tree.c:2824 handle_softirqs+0x283/0x870 kernel/softirq.c:579 do_softirq+0xec/0x180 kernel/softirq.c:480 __local_bh_enable_ip+0x17d/0x1c0 kernel/softirq.c:407 ipv6_get_lladdr+0x2aa/0x3f0 net/ipv6/addrconf.c:1937 mld_newpack+0x420/0xc40 net/ipv6/mcast.c:1802 add_grhead+0x5a/0x2a0 net/ipv6/mcast.c:1899 add_grec+0x13b2/0x1670 net/ipv6/mcast.c:2037 mld_send_cr net/ipv6/mcast.c:2163 [inline] mld_ifc_work+0x6e6/0xde0 net/ipv6/mcast.c:2702 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88802f4122a0 which belongs to the cache page->ptl of size 64 The buggy address is located 32 bytes inside of freed 64-byte region [ffff88802f4122a0, ffff88802f4122e0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2f412 anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801a04b780 0000000000000000 dead000000000001 raw: 0000000000000000 00000000002a002a 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5178, tgid 5178 (S02klogd), ts 25563923808, free_ts 24265026283 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+0x21c7/0x22a0 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 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2618 new_slab mm/slub.c:2672 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3858 __slab_alloc mm/slub.c:3948 [inline] __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] kmem_cache_alloc_noprof+0x283/0x3c0 mm/slub.c:4203 ptlock_alloc+0x20/0x70 mm/memory.c:7354 ptlock_init include/linux/mm.h:3074 [inline] pagetable_pte_ctor include/linux/mm.h:3122 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:73 [inline] pte_alloc_one+0x6d/0x160 arch/x86/mm/pgtable.c:17 __pte_alloc+0x25/0x160 mm/memory.c:430 copy_pte_range mm/memory.c:1100 [inline] copy_pmd_range+0x6903/0x7000 mm/memory.c:1255 copy_pud_range mm/memory.c:1292 [inline] copy_p4d_range mm/memory.c:1316 [inline] copy_page_range+0x95c/0xd40 mm/memory.c:1410 dup_mmap kernel/fork.c:726 [inline] dup_mm kernel/fork.c:1734 [inline] copy_mm+0x121c/0x2100 kernel/fork.c:1786 copy_process+0x16d3/0x3b80 kernel/fork.c:2429 kernel_clone+0x224/0x7f0 kernel/fork.c:2844 __do_sys_clone kernel/fork.c:2987 [inline] __se_sys_clone kernel/fork.c:2971 [inline] __x64_sys_clone+0x18b/0x1e0 kernel/fork.c:2971 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xb05/0xcd0 mm/page_alloc.c:2725 kasan_depopulate_vmalloc_pte+0x75/0x90 mm/kasan/shadow.c:408 apply_to_pte_range mm/memory.c:2941 [inline] apply_to_pmd_range mm/memory.c:2985 [inline] apply_to_pud_range mm/memory.c:3021 [inline] apply_to_p4d_range mm/memory.c:3057 [inline] __apply_to_page_range+0x7cb/0xd20 mm/memory.c:3093 kasan_release_vmalloc+0xa2/0xd0 mm/kasan/shadow.c:529 kasan_release_vmalloc_node mm/vmalloc.c:2196 [inline] purge_vmap_node+0x245/0x880 mm/vmalloc.c:2213 __purge_vmap_area_lazy+0x71a/0xae0 mm/vmalloc.c:2304 _vm_unmap_aliases+0x70f/0x7b0 mm/vmalloc.c:2899 change_page_attr_set_clr+0x31a/0xdc0 arch/x86/mm/pat/set_memory.c:2085 change_page_attr_set arch/x86/mm/pat/set_memory.c:2126 [inline] set_memory_nx+0xd6/0x110 arch/x86/mm/pat/set_memory.c:2302 free_init_pages arch/x86/mm/init.c:934 [inline] free_kernel_image_pages+0x85/0x100 arch/x86/mm/init.c:953 kernel_init+0x31/0x1d0 init/main.c:1466 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88802f412180: 00 00 00 00 00 00 00 00 fc fc fc fc 00 00 00 00 ffff88802f412200: 00 00 00 00 fc fc fc fc fa fb fb fb fb fb fb fb >ffff88802f412280: fc fc fc fc fa fb fb fb fb fb fb fb fc fc fc fc ^ ffff88802f412300: fa fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb ffff88802f412380: fb fb fb fb fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================