================================================================== 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+0x824/0x1240 fs/ocfs2/alloc.c:6054 Read of size 4 at addr ffff888055a47ff8 by task kworker/u8:11/10474 CPU: 1 UID: 0 PID: 10474 Comm: kworker/u8:11 Not tainted 6.13.0-rc4-syzkaller-00004-gf07044dd0df0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: ocfs2_wq ocfs2_truncate_log_worker 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_replay_truncate_records fs/ocfs2/alloc.c:5959 [inline] __ocfs2_flush_truncate_log+0x824/0x1240 fs/ocfs2/alloc.c:6054 ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6076 [inline] ocfs2_truncate_log_worker+0xa2/0x1b0 fs/ocfs2/alloc.c:6089 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa68/0x1840 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f2/0x390 kernel/kthread.c:389 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x61f pfn:0x55a47 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 000000000000061f 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 18401, tgid 18400 (syz.6.2318), ts 594424250239, free_ts 595284652103 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2269 folio_alloc_mpol_noprof+0x36/0x50 mm/mempolicy.c:2287 shmem_alloc_folio mm/shmem.c:1798 [inline] shmem_alloc_and_add_folio+0x4a0/0x1080 mm/shmem.c:1837 shmem_get_folio_gfp+0x621/0x1840 mm/shmem.c:2357 shmem_fault+0x220/0x5b0 mm/shmem.c:2558 __do_fault+0x137/0x390 mm/memory.c:4907 do_read_fault mm/memory.c:5322 [inline] do_fault mm/memory.c:5456 [inline] do_pte_missing mm/memory.c:3979 [inline] handle_pte_fault+0x39eb/0x5ed0 mm/memory.c:5801 __handle_mm_fault mm/memory.c:5944 [inline] handle_mm_fault+0x1106/0x1bb0 mm/memory.c:6112 faultin_page mm/gup.c:1196 [inline] __get_user_pages+0x1c82/0x49e0 mm/gup.c:1494 populate_vma_page_range+0x264/0x330 mm/gup.c:1932 __mm_populate+0x27a/0x460 mm/gup.c:2035 mm_populate include/linux/mm.h:3396 [inline] vm_mmap_pgoff+0x2c3/0x3d0 mm/util.c:585 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 page last free pid 18424 tgid 18400 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe39/0x18b0 mm/page_alloc.c:2706 folios_put_refs+0x76c/0x860 mm/swap.c:962 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x593/0x1820 mm/shmem.c:1044 shmem_truncate_range mm/shmem.c:1156 [inline] shmem_evict_inode+0x29b/0xa80 mm/shmem.c:1284 evict+0x4ea/0x9a0 fs/inode.c:796 __dentry_kill+0x20d/0x630 fs/dcache.c:625 dput+0x19f/0x2b0 fs/dcache.c:867 __fput+0x5ba/0xa50 fs/file_table.c:458 task_work_run+0x251/0x310 kernel/task_work.c:239 exit_task_work include/linux/task_work.h:43 [inline] do_exit+0xa2a/0x28e0 kernel/exit.c:938 do_group_exit+0x207/0x2c0 kernel/exit.c:1087 get_signal+0x16b2/0x1750 kernel/signal.c:3017 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [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+0xce/0x340 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888055a47e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888055a47f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888055a47f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888055a48000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888055a48080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================