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): Created .reiserfs_priv - reserved for xattr storage. ================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:376 [inline] BUG: KASAN: use-after-free in leaf_paste_in_buffer+0x637/0xb80 fs/reiserfs/lbalance.c:1037 Write of size 408 at addr ffff88808a8f5e68 by task syz-executor226/7948 CPU: 0 PID: 7948 Comm: syz-executor226 Not tainted 4.14.302-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351 kasan_report+0x6f/0x80 mm/kasan/report.c:409 memcpy+0x35/0x50 mm/kasan/kasan.c:303 memcpy include/linux/string.h:376 [inline] leaf_paste_in_buffer+0x637/0xb80 fs/reiserfs/lbalance.c:1037 leaf_copy_boundary_item fs/reiserfs/lbalance.c:199 [inline] leaf_copy_items fs/reiserfs/lbalance.c:551 [inline] leaf_move_items+0xf26/0x3440 fs/reiserfs/lbalance.c:726 leaf_shift_left+0x9f/0x360 fs/reiserfs/lbalance.c:750 balance_leaf_paste_left_shift fs/reiserfs/do_balan.c:464 [inline] balance_leaf_paste_left fs/reiserfs/do_balan.c:598 [inline] balance_leaf_left fs/reiserfs/do_balan.c:619 [inline] balance_leaf+0x5c85/0xba30 fs/reiserfs/do_balan.c:1420 do_balance+0x282/0x630 fs/reiserfs/do_balan.c:1899 reiserfs_paste_into_item+0x569/0x6f0 fs/reiserfs/stree.c:2169 reiserfs_get_block+0x1691/0x36b0 fs/reiserfs/inode.c:1076 __block_write_begin_int+0x35c/0x11d0 fs/buffer.c:2038 reiserfs_write_begin+0x2e3/0x8a0 fs/reiserfs/inode.c:2793 generic_cont_expand_simple+0xe1/0x130 fs/buffer.c:2388 reiserfs_setattr+0xa1c/0xe00 fs/reiserfs/inode.c:3321 notify_change+0x56b/0xd10 fs/attr.c:315 do_truncate+0xff/0x1a0 fs/open.c:63 do_sys_ftruncate.constprop.0+0x3a3/0x480 fs/open.c:205 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 RIP: 0033:0x7f958ee327b9 RSP: 002b:00007ffdf78655e8 EFLAGS: 00000246 ORIG_RAX: 000000000000004d RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f958ee327b9 RDX: 0000000000000000 RSI: 0000000002007ffb RDI: 0000000000000004 RBP: 00007f958edf2050 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000010f8 R11: 0000000000000246 R12: 00007f958edf20e0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:ffffea00022a3d40 count:0 mapcount:0 mapping: (null) index:0x1 flags: 0xfff00000000000() raw: 00fff00000000000 0000000000000000 0000000000000001 00000000ffffffff raw: ffffea00022a3da0 ffffea00022a3d20 0000000000000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808a8f5d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88808a8f5d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88808a8f5e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88808a8f5e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88808a8f5f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================