REISERFS (device loop2): Using r5 hash to sort names REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage. ================================================================== 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 80 at addr ffff888035434fe0 by task syz-executor.2/21141 CPU: 1 PID: 21141 Comm: syz-executor.2 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_left fs/reiserfs/do_balan.c:622 [inline] balance_leaf+0x2fb8/0xca70 fs/reiserfs/do_balan.c:1420 do_balance+0x30a/0x760 fs/reiserfs/do_balan.c:1899 reiserfs_insert_item+0xbf3/0x1010 fs/reiserfs/stree.c:2271 reiserfs_get_block+0x122b/0x3e40 fs/reiserfs/inode.c:876 __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 __kernel_write+0x109/0x370 fs/read_write.c:506 dump_emit+0x183/0x300 fs/coredump.c:801 elf_core_dump+0x2914/0x4c10 fs/binfmt_elf.c:2335 do_coredump+0x1d4e/0x2d60 fs/coredump.c:765 get_signal+0xed9/0x1f70 kernel/signal.c:2583 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x277/0x2d0 arch/x86/entry/common.c:198 retint_user+0x8/0x18 RIP: 0033:0x7f8d0122fe97 Code: 38 5d 41 5c c3 48 8d 3d 8d ea 0b 00 e8 72 f8 ff ff 48 8d 3d 8f ea 0b 00 e8 66 f8 ff ff 66 0f 1f 44 00 00 55 89 fd 48 83 ec 10 <64> 8b 04 25 b4 ff ff ff 85 c0 74 2a 89 fe 31 c0 bf 3c 00 00 00 e8 RSP: 002b:00007f8cff7e7260 EFLAGS: 00010206 RAX: 0000000000000000 RBX: 00007f8d013b3f80 RCX: 00007f8d012940c9 RDX: 00007f8cff7e7280 RSI: 00007f8cff7e73b0 RDI: 000000000000000b RBP: 000000000000000b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffecec4c18f R14: 00007f8cff806300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea0000d50d00 count:2 mapcount:0 mapping:ffff8880b54023e0 index:0x213 flags: 0xfff00000001064(referenced|lru|active|private) raw: 00fff00000001064 ffffea0000f1d9c8 ffffea0000dcf588 ffff8880b54023e0 raw: 0000000000000213 ffff88804fa3a000 00000002ffffffff ffff8880b59f68c0 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8880b59f68c0 Memory state around the buggy address: ffff888035434f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888035434f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888035435000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888035435080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888035435100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================