================================================================== BUG: KASAN: use-after-free in ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5959 [inline] BUG: KASAN: use-after-free in __ocfs2_flush_truncate_log+0x7bc/0x1130 fs/ocfs2/alloc.c:6054 Read of size 4 at addr ffff8880414c3530 by task syz-executor/5790 CPU: 1 PID: 5790 Comm: syz-executor Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xa8/0x210 mm/kasan/report.c:468 kasan_report+0x117/0x150 mm/kasan/report.c:581 ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5959 [inline] __ocfs2_flush_truncate_log+0x7bc/0x1130 fs/ocfs2/alloc.c:6054 ocfs2_flush_truncate_log+0x4f/0x60 fs/ocfs2/alloc.c:6076 ocfs2_sync_fs+0x11d/0x330 fs/ocfs2/super.c:402 sync_filesystem+0x1c2/0x220 fs/sync.c:66 generic_shutdown_super+0x6f/0x2b0 fs/super.c:663 kill_block_super+0x44/0x90 fs/super.c:1671 deactivate_locked_super+0x9c/0x210 fs/super.c:479 cleanup_mnt+0x3d7/0x460 fs/namespace.c:1259 task_work_run+0x1d4/0x260 kernel/task_work.c:245 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:180 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213 __syscall_exit_to_user_mode_work kernel/entry/common.c:294 [inline] syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:305 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fd0ad7aa7c7 Code: a2 c7 05 2c 4f 25 00 00 00 00 00 eb 96 e8 b1 13 00 00 90 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 e8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffc4bc0ef18 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 00007fd0ad83751b RCX: 00007fd0ad7aa7c7 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc4bc0efd0 RBP: 00007ffc4bc0efd0 R08: 00007ffc4bc0ffd0 R09: 00000000ffffffff R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc4bc10060 R13: 00007fd0ad83751b R14: 000000000004999e R15: 00007ffc4bc100a0 The buggy address belongs to the physical page: page:ffffea00010530c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x414c3 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000001 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 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 7118, tgid 7118 (syz.2.349), ts 297839741803, free_ts 300798838309 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582 prep_new_page mm/page_alloc.c:1589 [inline] get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501 __folio_alloc+0x10/0x20 mm/page_alloc.c:4533 vma_alloc_folio+0x474/0x8f0 mm/mempolicy.c:2240 shmem_alloc_folio+0x1a9/0x2a0 mm/shmem.c:1679 shmem_alloc_and_acct_folio+0x1cb/0x6c0 mm/shmem.c:1704 shmem_get_folio_gfp+0xe1d/0x2b40 mm/shmem.c:2041 shmem_get_folio mm/shmem.c:2164 [inline] shmem_write_begin+0xf2/0x430 mm/shmem.c:2706 generic_perform_write+0x2fe/0x5c0 mm/filemap.c:4027 shmem_file_write_iter+0xfb/0x120 mm/shmem.c:2883 __kernel_write_iter+0x29f/0x6d0 fs/read_write.c:517 dump_emit_page fs/coredump.c:958 [inline] dump_user_range+0x389/0x7c0 fs/coredump.c:985 elf_core_dump+0x320e/0x37c0 fs/binfmt_elf.c:2184 do_coredump+0x19b8/0x2960 fs/coredump.c:834 get_signal+0x10da/0x1390 kernel/signal.c:2913 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1182 [inline] free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366 free_unref_page_list+0xbe/0x860 mm/page_alloc.c:2505 release_pages+0x208a/0x2300 mm/swap.c:1022 __folio_batch_release+0x71/0xe0 mm/swap.c:1042 folio_batch_release include/linux/pagevec.h:83 [inline] shmem_undo_range+0x5ff/0x1a80 mm/shmem.c:1026 shmem_truncate_range mm/shmem.c:1135 [inline] shmem_evict_inode+0x285/0xa70 mm/shmem.c:1264 evict+0x4b3/0x9d0 fs/inode.c:702 do_unlinkat+0x38c/0x590 fs/namei.c:4465 __do_sys_unlink fs/namei.c:4506 [inline] __se_sys_unlink fs/namei.c:4504 [inline] __x64_sys_unlink+0x49/0x50 fs/namei.c:4504 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff8880414c3400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880414c3480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880414c3500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880414c3580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880414c3600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================