================================================================== BUG: KASAN: use-after-free in ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5967 [inline] BUG: KASAN: use-after-free in __ocfs2_flush_truncate_log+0x7c7/0x10e0 fs/ocfs2/alloc.c:6062 Read of size 4 at addr ffff8880556a02c0 by task kworker/u8:2/36 CPU: 1 UID: 0 PID: 36 Comm: kworker/u8:2 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 Workqueue: ocfs2_wq ocfs2_truncate_log_worker Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 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 fs/ocfs2/alloc.c:6084 [inline] ocfs2_truncate_log_worker+0xa2/0x190 fs/ocfs2/alloc.c:6097 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x1833 pfn:0x556a0 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffffea00015bc808 ffffea00015bb808 0000000000000000 raw: 0000000000001833 0000000000000005 00000000f0000000 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 21606, tgid 21603 (syz.4.1863), ts 803003417548, free_ts 805375564650 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 folio_alloc_mpol_noprof+0x39/0x70 mm/mempolicy.c:2435 shmem_alloc_folio mm/shmem.c:1871 [inline] shmem_alloc_and_add_folio+0x447/0xf60 mm/shmem.c:1910 shmem_get_folio_gfp+0x59d/0x1660 mm/shmem.c:2533 shmem_get_folio mm/shmem.c:2639 [inline] shmem_fallocate+0x80f/0xde0 mm/shmem.c:3747 vfs_fallocate+0x669/0x7e0 fs/open.c:342 ksys_fallocate fs/open.c:366 [inline] __do_sys_fallocate fs/open.c:371 [inline] __se_sys_fallocate fs/open.c:369 [inline] __x64_sys_fallocate+0xc0/0x110 fs/open.c:369 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5864 tgid 5864 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] free_unref_folios+0xdb3/0x14f0 mm/page_alloc.c:2963 folios_put_refs+0x584/0x670 mm/swap.c:1002 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x49e/0x14b0 mm/shmem.c:1120 shmem_truncate_range mm/shmem.c:1232 [inline] shmem_evict_inode+0x272/0xa70 mm/shmem.c:1360 evict+0x504/0x9c0 fs/inode.c:810 do_unlinkat+0x39f/0x560 fs/namei.c:4744 __do_sys_unlink fs/namei.c:4783 [inline] __se_sys_unlink fs/namei.c:4781 [inline] __x64_sys_unlink+0x47/0x50 fs/namei.c:4781 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880556a0180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880556a0200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880556a0280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880556a0300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880556a0380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================