REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. xt_cgroup: path and classid specified ================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:377 [inline] BUG: KASAN: use-after-free in leaf_paste_in_buffer+0xa27/0xc20 fs/reiserfs/lbalance.c:1043 Read of size 112 at addr ffff888015d85fd0 by task syz-executor.4/28735 CPU: 1 PID: 28735 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report+0x8f/0xa0 mm/kasan/report.c:412 memcpy+0x20/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:377 [inline] leaf_paste_in_buffer+0xa27/0xc20 fs/reiserfs/lbalance.c:1043 leaf_copy_dir_entries.isra.0+0x7f3/0x980 fs/reiserfs/lbalance.c:108 leaf_copy_boundary_item fs/reiserfs/lbalance.c:168 [inline] leaf_copy_items fs/reiserfs/lbalance.c:551 [inline] leaf_move_items+0x17f6/0x3b60 fs/reiserfs/lbalance.c:726 leaf_shift_left+0xa0/0x380 fs/reiserfs/lbalance.c:750 balance_leaf_paste_left_whole fs/reiserfs/do_balan.c:566 [inline] balance_leaf_paste_left fs/reiserfs/do_balan.c:600 [inline] balance_leaf_left fs/reiserfs/do_balan.c:619 [inline] balance_leaf+0x502e/0xca70 fs/reiserfs/do_balan.c:1420 do_balance+0x30a/0x760 fs/reiserfs/do_balan.c:1899 reiserfs_paste_into_item+0x636/0x7d0 fs/reiserfs/stree.c:2169 reiserfs_get_block+0x19ee/0x3e40 fs/reiserfs/inode.c:1077 __block_write_begin_int+0x46c/0x17b0 fs/buffer.c:1978 reiserfs_write_begin+0x39f/0xa10 fs/reiserfs/inode.c:2794 generic_perform_write+0x1f8/0x4d0 mm/filemap.c:3170 __generic_file_write_iter+0x24b/0x610 mm/filemap.c:3295 generic_file_write_iter+0x3f8/0x730 mm/filemap.c:3323 call_write_iter include/linux/fs.h:1821 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x51b/0x770 fs/read_write.c:487 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f9e4d2b80d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007f9e4b82a168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f9e4d3d7f80 RCX: 00007f9e4d2b80d9 RDX: 000000000208e24b RSI: 0000000020000000 RDI: 0000000000000006 RBP: 00007f9e4d313ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd6cfa35bf R14: 00007f9e4b82a300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea0000576140 count:2 mapcount:0 mapping:ffff88808e43cc20 index:0x2e0 flags: 0xfff00000001064(referenced|lru|active|private) raw: 00fff00000001064 ffffea0002244a88 ffffea00007f1f48 ffff88808e43cc20 raw: 00000000000002e0 ffff8880393f2540 00000002ffffffff ffff8880b59f68c0 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8880b59f68c0 Memory state around the buggy address: ffff888015d85f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888015d85f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888015d86000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888015d86080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888015d86100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== REISERFS (device loop1): found reiserfs format "3.6" with non-standard journal REISERFS (device loop3): found reiserfs format "3.6" with non-standard journal REISERFS (device loop1): using ordered data mode REISERFS (device loop3): using ordered data mode reiserfs: using flush barriers reiserfs: using flush barriers REISERFS (device loop1): journal params: device loop1, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop3): journal params: device loop3, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 xt_cgroup: path and classid specified REISERFS (device loop1): checking transaction log (loop1) REISERFS (device loop3): checking transaction log (loop3) REISERFS (device loop1): Using r5 hash to sort names REISERFS (device loop3): Using r5 hash to sort names REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage. REISERFS (device loop3): Created .reiserfs_priv - reserved for xattr storage.