================================================================== 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 ffff888041c7fff8 by task syz-executor/5755 CPU: 0 UID: 0 PID: 5755 Comm: syz-executor Not tainted 6.16.0-rc4-syzkaller-gd0b3b7b22dfa #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xd2/0x2b0 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:622 kill_block_super+0x44/0x90 fs/super.c:1755 deactivate_locked_super+0xbc/0x130 fs/super.c:474 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1417 task_work_run+0x1d1/0x260 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:114 exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:414 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline] do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa44f97f227 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:00007ffdb57d8dc8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 00007fa44f9f0a14 RCX: 00007fa44f97f227 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffdb57d8e80 RBP: 00007ffdb57d8e80 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffdb57d9f00 R13: 00007fa44f9f0a14 R14: 0000000000024673 R15: 00007ffdb57d9f40 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xc002b90 pfn:0x41c7f flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 000000000c002b90 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_ZERO|__GFP_COMP), pid 5610, tgid 5610 (syz-execprog), ts 129541595433, free_ts 145676780521 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704 compaction_alloc_noprof mm/compaction.c:1872 [inline] compaction_alloc+0x3141/0x3540 mm/compaction.c:1883 migrate_folio_unmap mm/migrate.c:1148 [inline] migrate_pages_batch+0x79d/0x2830 mm/migrate.c:1807 migrate_pages_sync mm/migrate.c:1930 [inline] migrate_pages+0x1bcc/0x2930 mm/migrate.c:2039 compact_zone+0x23f4/0x4ad0 mm/compaction.c:2683 compact_node+0x1d2/0x280 mm/compaction.c:2952 kcompactd+0xbc8/0x1290 mm/compaction.c:3250 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page last free pid 30 tgid 30 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0xc71/0xe70 mm/page_alloc.c:2706 __folio_put+0x21b/0x2c0 mm/swap.c:112 migrate_folio_move mm/migrate.c:1343 [inline] migrate_folios_move mm/migrate.c:1653 [inline] migrate_pages_batch+0x2118/0x2830 mm/migrate.c:1900 migrate_pages_sync mm/migrate.c:1930 [inline] migrate_pages+0x1bcc/0x2930 mm/migrate.c:2039 compact_zone+0x23f4/0x4ad0 mm/compaction.c:2683 compact_node+0x1d2/0x280 mm/compaction.c:2952 kcompactd+0xbc8/0x1290 mm/compaction.c:3250 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888041c7fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888041c7ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888041c7ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888041c80000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888041c80080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================