================================================================== BUG: KASAN: use-after-free in leaf_paste_in_buffer+0x1e7/0xaf0 fs/reiserfs/lbalance.c:1017 Write of size 4096 at addr ffff88807145de74 by task syz.4.277/5189 CPU: 0 PID: 5189 Comm: syz.4.277 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x235/0x290 mm/kasan/generic.c:189 memmove+0x3c/0x60 mm/kasan/shadow.c:55 leaf_paste_in_buffer+0x1e7/0xaf0 fs/reiserfs/lbalance.c:1017 leaf_copy_boundary_item+0xc8f/0x21e0 fs/reiserfs/lbalance.c:199 leaf_copy_items fs/reiserfs/lbalance.c:551 [inline] leaf_move_items+0x85f/0xe00 fs/reiserfs/lbalance.c:726 leaf_shift_left+0xb1/0x3f0 fs/reiserfs/lbalance.c:750 balance_leaf_paste_left_shift fs/reiserfs/do_balan.c:458 [inline] balance_leaf_paste_left fs/reiserfs/do_balan.c:592 [inline] balance_leaf_left fs/reiserfs/do_balan.c:613 [inline] balance_leaf+0x5072/0x10ec0 fs/reiserfs/do_balan.c:1409 do_balance+0x318/0x930 fs/reiserfs/do_balan.c:1888 reiserfs_paste_into_item+0x744/0x7f0 fs/reiserfs/stree.c:2159 reiserfs_get_block+0x1c3d/0x4360 fs/reiserfs/inode.c:1077 __block_write_begin_int+0x565/0x15d0 fs/buffer.c:2012 reiserfs_write_begin+0x353/0x820 fs/reiserfs/inode.c:2790 generic_cont_expand_simple+0xf0/0x1a0 fs/buffer.c:2362 reiserfs_setattr+0x3f5/0x10d0 fs/reiserfs/inode.c:3319 notify_change+0xbc6/0xee0 fs/attr.c:505 do_truncate+0x1ac/0x240 fs/open.c:65 do_sys_ftruncate+0x31b/0x3d0 fs/open.c:193 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fdaa5ee20d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdaa4119028 EFLAGS: 00000246 ORIG_RAX: 000000000000004d RAX: ffffffffffffffda RBX: 00007fdaa616a090 RCX: 00007fdaa5ee20d9 RDX: 0000000000000000 RSI: 0000000006000809 RDI: 0000000000000006 RBP: 00007fdaa5f79024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdaa616a128 R14: 00007fdaa616a090 R15: 00007ffe931e79b8 The buggy address belongs to the page: page:ffffea0001c51740 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x7145d flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00014cc588 ffffea00014bb508 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 0x1100cca(GFP_HIGHUSER_MOVABLE), pid 5079, ts 137878505742, free_ts 142373887298 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501 alloc_pages_vma+0x2bc/0x790 mm/mempolicy.c:2146 shmem_alloc_page mm/shmem.c:1586 [inline] shmem_alloc_and_acct_page+0x47f/0xbe0 mm/shmem.c:1611 shmem_getpage_gfp+0x14be/0x2c10 mm/shmem.c:1906 shmem_fault+0x1ac/0x550 mm/shmem.c:2118 __do_fault+0x141/0x330 mm/memory.c:3928 do_read_fault mm/memory.c:4264 [inline] do_fault mm/memory.c:4392 [inline] handle_pte_fault mm/memory.c:4650 [inline] __handle_mm_fault mm/memory.c:4785 [inline] handle_mm_fault+0x2982/0x4440 mm/memory.c:4883 faultin_page mm/gup.c:976 [inline] __get_user_pages+0x952/0x11e0 mm/gup.c:1197 populate_vma_page_range+0x213/0x290 mm/gup.c:1529 __mm_populate+0x275/0x3b0 mm/gup.c:1638 mm_populate include/linux/mm.h:2646 [inline] vm_mmap_pgoff+0x212/0x2d0 mm/util.c:556 ksys_mmap_pgoff+0x140/0x790 mm/mmap.c:1635 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page_list+0x119/0x830 mm/page_alloc.c:3433 release_pages+0x185f/0x1bd0 mm/swap.c:963 __pagevec_release+0x6d/0xe0 mm/swap.c:983 pagevec_release include/linux/pagevec.h:81 [inline] shmem_undo_range+0x5cd/0x19a0 mm/shmem.c:964 shmem_truncate_range mm/shmem.c:1063 [inline] shmem_evict_inode+0x1e2/0x9a0 mm/shmem.c:1145 evict+0x4b6/0x8b0 fs/inode.c:647 __dentry_kill+0x412/0x630 fs/dcache.c:586 dentry_kill+0xb8/0x290 fs/dcache.c:-1 dput+0xd8/0x1a0 fs/dcache.c:893 __fput+0x5a5/0x8c0 fs/file_table.c:319 task_work_run+0x125/0x1a0 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0x635/0x2110 kernel/exit.c:890 do_group_exit+0x12c/0x2f0 kernel/exit.c:1004 get_signal+0x7eb/0x12e0 kernel/signal.c:2909 arch_do_signal_or_restart+0xe6/0x12a0 arch/x86/kernel/signal.c:867 Memory state around the buggy address: ffff88807145dd00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807145dd80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88807145de00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807145de80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807145df00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================