REISERFS (device loop0): journal params: device loop0, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop0): checking transaction log (loop0) REISERFS (device loop0): Using r5 hash to sort names REISERFS (device loop0): using 3.5.x disk format REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage. ================================================================== BUG: KASAN: use-after-free in leaf_paste_in_buffer+0x615/0xab0 fs/reiserfs/lbalance.c:-1 Read of size 48 at addr ffff88806f3a6ff0 by task syz-executor622/4184 CPU: 0 PID: 4184 Comm: syz-executor622 Not tainted 5.15.184-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x230 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+0x27b/0x290 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 leaf_paste_in_buffer+0x615/0xab0 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 leaf_shift_left+0xb9/0x450 fs/reiserfs/lbalance.c:750 balance_leaf_left fs/reiserfs/do_balan.c:616 [inline] balance_leaf+0x13db/0x10e60 fs/reiserfs/do_balan.c:1409 do_balance+0x2fa/0x930 fs/reiserfs/do_balan.c:1888 reiserfs_insert_item+0xa4f/0xbb0 fs/reiserfs/stree.c:2261 add_save_link+0x366/0x5c0 fs/reiserfs/super.c:495 reiserfs_truncate_file+0x610/0xdc0 fs/reiserfs/inode.c:2317 reiserfs_setattr+0xaa7/0x1010 fs/reiserfs/inode.c:3409 notify_change+0xbcd/0xee0 fs/attr.c:505 do_truncate+0x197/0x220 fs/open.c:65 handle_truncate fs/namei.c:3265 [inline] do_open fs/namei.c:3612 [inline] path_openat+0x28af/0x2f30 fs/namei.c:3742 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1280 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:0x7f6f2fa0a2a9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffcb958cee8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f6f2fa0a2a9 RDX: 000000000000275a RSI: 0000200000000200 RDI: 0000000000000004 RBP: 0000000000000000 R08: 00007ffcb958cf20 R09: 00007ffcb958cf20 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffcb958cf0c R13: 0000000000000008 R14: 431bde82d7b634db R15: 00007ffcb958cf40 The buggy address belongs to the page: page:ffffea0001bce980 refcount:2 mapcount:0 mapping:ffff8881408c4f30 index:0x214 pfn:0x6f3a6 memcg:ffff888016a7c000 aops:def_blk_aops ino:700000 flags: 0xfff00000002032(referenced|lru|active|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000002032 ffffea0001bc8948 ffffea0001ef8388 ffff8881408c4f30 raw: 0000000000000214 ffff88806f46a910 00000002ffffffff ffff888016a7c000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), pid 4184, ts 63065913204, free_ts 63065639140 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5466 __page_cache_alloc+0xd2/0x3f0 mm/filemap.c:1022 pagecache_get_page+0x986/0xef0 mm/filemap.c:1940 find_or_create_page include/linux/pagemap.h:420 [inline] grow_dev_page fs/buffer.c:949 [inline] grow_buffers fs/buffer.c:1014 [inline] __getblk_slow fs/buffer.c:1041 [inline] __getblk_gfp+0x249/0xb70 fs/buffer.c:1336 sb_getblk include/linux/buffer_head.h:361 [inline] get_empty_nodes+0x511/0x8c0 fs/reiserfs/fix_node.c:890 fix_nodes+0x1e69/0x82d0 fs/reiserfs/fix_node.c:2662 reiserfs_insert_item+0x973/0xbb0 fs/reiserfs/stree.c:2240 indirect2direct+0x594/0x9c0 fs/reiserfs/tail_conversion.c:283 maybe_indirect_to_direct fs/reiserfs/stree.c:1587 [inline] reiserfs_cut_from_item+0x76a/0x1ef0 fs/reiserfs/stree.c:1694 reiserfs_do_truncate+0xa90/0x13e0 fs/reiserfs/stree.c:1973 reiserfs_truncate_file+0x632/0xdc0 fs/reiserfs/inode.c:2318 reiserfs_setattr+0xaa7/0x1010 fs/reiserfs/inode.c:3409 notify_change+0xbcd/0xee0 fs/attr.c:505 do_truncate+0x197/0x220 fs/open.c:65 do_sys_ftruncate+0x31b/0x3d0 fs/open.c:193 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+0x122/0x7e0 mm/page_alloc.c:3433 release_pages+0x184b/0x1bb0 mm/swap.c:963 __pagevec_release+0x6d/0xe0 mm/swap.c:983 pagevec_release include/linux/pagevec.h:81 [inline] truncate_inode_pages_range+0x2f3/0xef0 mm/truncate.c:329 truncate_inode_pages mm/truncate.c:425 [inline] truncate_pagecache mm/truncate.c:735 [inline] truncate_setsize+0xb9/0xe0 mm/truncate.c:760 reiserfs_setattr+0xa9a/0x1010 fs/reiserfs/inode.c:3408 notify_change+0xbcd/0xee0 fs/attr.c:505 do_truncate+0x197/0x220 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 Memory state around the buggy address: ffff88806f3a6f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88806f3a6f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88806f3a7000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806f3a7080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806f3a7100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================