================================================================== BUG: KASAN: use-after-free in leaf_paste_in_buffer+0x617/0xaa0 fs/reiserfs/lbalance.c:-1 Read of size 48 at addr ffff888031548ff0 by task syz.1.58/4633 CPU: 1 PID: 4633 Comm: syz.1.58 Not tainted 6.1.147-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0xa8/0x200 mm/kasan/report.c:418 kasan_report+0x10b/0x140 mm/kasan/report.c:522 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x27b/0x290 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 leaf_paste_in_buffer+0x617/0xaa0 fs/reiserfs/lbalance.c:-1 leaf_copy_dir_entries+0x56c/0x8f0 fs/reiserfs/lbalance.c:108 leaf_copy_boundary_item+0xb8c/0x2190 fs/reiserfs/lbalance.c:168 leaf_copy_items fs/reiserfs/lbalance.c:551 [inline] leaf_move_items+0x84a/0xde0 fs/reiserfs/lbalance.c:726 balance_leaf_when_delete_left fs/reiserfs/do_balan.c:167 [inline] balance_leaf_when_delete fs/reiserfs/do_balan.c:272 [inline] balance_leaf+0xc2fa/0x10e60 fs/reiserfs/do_balan.c:1393 do_balance+0x2fa/0x930 fs/reiserfs/do_balan.c:1888 reiserfs_cut_from_item+0x1391/0x1ef0 fs/reiserfs/stree.c:1838 reiserfs_do_truncate+0xa90/0x13e0 fs/reiserfs/stree.c:1973 reiserfs_truncate_file+0x376/0x7c0 fs/reiserfs/inode.c:2310 reiserfs_setattr+0xcae/0x1240 fs/reiserfs/inode.c:3395 notify_change+0xc74/0xf40 fs/attr.c:499 do_truncate+0x197/0x220 fs/open.c:65 handle_truncate fs/namei.c:3285 [inline] do_open fs/namei.c:3630 [inline] path_openat+0x27f2/0x2e70 fs/namei.c:3783 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1345 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f93f4b8ebe9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f93f59c4038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f93f4db6270 RCX: 00007f93f4b8ebe9 RDX: 0000000000000300 RSI: 0000200000000080 RDI: ffffffffffffff9c RBP: 00007f93f4c11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f93f4db6308 R14: 00007f93f4db6270 R15: 00007ffe76009bd8 The buggy address belongs to the physical page: page:ffffea0000c55200 refcount:2 mapcount:0 mapping:ffff8880178849f8 index:0x389 pfn:0x31548 memcg:ffff88813fe10000 aops:def_blk_aops ino:700001 flags: 0xfff58000022056(referenced|uptodate|lru|workingset|private|mappedtodisk|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff58000022056 ffffea0001f43f88 ffffea00015b2b48 ffff8880178849f8 raw: 0000000000000389 ffff888054acb570 00000002ffffffff ffff88813fe10000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 4392, tgid 4392 (udevd), ts 120125158973, free_ts 120116088888 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614 folio_alloc+0x1c/0x60 mm/mempolicy.c:2292 filemap_alloc_folio+0xdb/0x460 mm/filemap.c:999 page_cache_ra_unbounded+0x177/0x770 mm/readahead.c:248 do_page_cache_ra mm/readahead.c:300 [inline] force_page_cache_ra mm/readahead.c:331 [inline] page_cache_sync_ra+0x3d7/0x490 mm/readahead.c:713 page_cache_sync_readahead include/linux/pagemap.h:1248 [inline] filemap_get_pages mm/filemap.c:2665 [inline] filemap_read+0x5ff/0x2f80 mm/filemap.c:2759 blkdev_read_iter+0x3d5/0x500 block/fops.c:614 call_read_iter include/linux/fs.h:2259 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x434/0x920 fs/read_write.c:470 ksys_read+0x143/0x240 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare mm/page_alloc.c:1509 [inline] free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479 rcu_do_batch kernel/rcu/tree.c:2297 [inline] rcu_core+0x9c0/0x16a0 kernel/rcu/tree.c:2557 handle_softirqs+0x2a1/0x920 kernel/softirq.c:596 __do_softirq kernel/softirq.c:630 [inline] invoke_softirq kernel/softirq.c:470 [inline] __irq_exit_rcu+0x12f/0x220 kernel/softirq.c:679 irq_exit_rcu+0x5/0x20 kernel/softirq.c:691 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline] sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691 Memory state around the buggy address: ffff888031548f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888031548f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888031549000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888031549080: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888031549100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================