================================================================== BUG: KASAN: use-after-free in leaf_paste_in_buffer+0x578/0x9f0 Read of size 48 at addr ffff00010647fff0 by task syz-executor.0/8742 CPU: 1 PID: 8742 Comm: syz-executor.0 Not tainted 6.1.90-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x174/0x4c0 mm/kasan/report.c:395 kasan_report+0xd4/0x130 mm/kasan/report.c:495 kasan_check_range+0x264/0x2a4 mm/kasan/generic.c:189 memcpy+0x48/0x90 mm/kasan/shadow.c:65 leaf_paste_in_buffer+0x578/0x9f0 leaf_copy_dir_entries+0x2b4/0xa04 fs/reiserfs/lbalance.c:108 leaf_copy_boundary_item+0x8c4/0x1a34 fs/reiserfs/lbalance.c:168 leaf_copy_items fs/reiserfs/lbalance.c:551 [inline] leaf_move_items+0xa0c/0x1f7c fs/reiserfs/lbalance.c:726 leaf_shift_left+0xc8/0x39c fs/reiserfs/lbalance.c:750 balance_leaf_when_delete_left fs/reiserfs/do_balan.c:194 [inline] balance_leaf_when_delete fs/reiserfs/do_balan.c:272 [inline] balance_leaf+0x2a70/0xe860 fs/reiserfs/do_balan.c:1393 do_balance+0x27c/0x788 fs/reiserfs/do_balan.c:1888 reiserfs_delete_item+0x994/0xde8 fs/reiserfs/stree.c:1371 direct2indirect+0x8b4/0x10f8 fs/reiserfs/tail_conversion.c:139 reiserfs_get_block+0x40c4/0x45d8 fs/reiserfs/inode.c:949 __block_write_begin_int+0x340/0x13b4 fs/buffer.c:1991 __block_write_begin+0x7c/0xa0 fs/buffer.c:2041 reiserfs_write_begin+0x328/0x71c fs/reiserfs/inode.c:2775 generic_perform_write+0x278/0x55c mm/filemap.c:3817 __generic_file_write_iter+0x168/0x388 mm/filemap.c:3945 generic_file_write_iter+0xb8/0x2b4 mm/filemap.c:3977 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x610/0x914 fs/read_write.c:584 ksys_write+0x15c/0x26c fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:646 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 The buggy address belongs to the physical page: page:0000000020c9e763 refcount:3 mapcount:0 mapping:00000000f7a82b8f index:0x225 pfn:0x14647f memcg:ffff0000dfde6000 aops:def_blk_aops ino:700000 flags: 0x5ffc40000002042(referenced|workingset|private|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc40000002042 0000000000000000 dead000000000122 ffff0000c0494a10 raw: 0000000000000225 ffff0000df2cd828 00000003ffffffff ffff0000dfde6000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff00010647ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff00010647ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff000106480000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff000106480080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff000106480100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== REISERFS error (device loop0): vs-4010 is_reusable: block number is out of range 11822 (1024) REISERFS (device loop0): Remounting filesystem read-only REISERFS error (device loop0): vs-4010 is_reusable: block number is out of range 262180 (1024) REISERFS error (device loop0): vs-4010 is_reusable: block number is out of range 589868 (1024) REISERFS error (device loop0): vs-4080 _reiserfs_free_block: block 1: bit already cleared ------------[ cut here ]------------ WARNING: CPU: 1 PID: 8742 at fs/reiserfs/journal.c:3397 journal_end+0x1a4/0x260 Modules linked in: CPU: 1 PID: 8742 Comm: syz-executor.0 Tainted: G B 6.1.90-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : journal_end+0x1a4/0x260 lr : journal_end+0x1a0/0x260 sp : ffff80001fa475c0 x29: ffff80001fa475c0 x28: dfff800000000000 x27: 1ffff00003f48ed2 x26: 1fffe0001e71b930 x25: 1ffff00003f48ed0 x24: dfff800000000000 x23: ffff80001fa47680 x22: 0000000000000000 x21: ffff80001fa47694 x20: ffff0000f38dc980 x19: ffff80001fa47680 x18: 1fffe0003686f576 x17: ffff80001583d000 x16: ffff8000120a7780 x15: ffff0001b437abbc x14: ffff0001b437abb8 x13: 1fffe0003686f576 x12: 0000000000040000 x11: 000000000003ffff x10: ffff80001e6c9000 x9 : ffff800008db4a70 x8 : 0000000000040000 x7 : 0000000000000000 x6 : ffff80000827c88c x5 : 0000000000000000 x4 : 0000000000000008 x3 : 0000000000000020 x2 : 0000000000000008 x1 : 0000000000000000 x0 : 00000000fffffffb Call trace: journal_end+0x1a4/0x260 reiserfs_truncate_file+0x51c/0xb1c fs/reiserfs/inode.c:2311 reiserfs_truncate_failed_write fs/reiserfs/inode.c:2743 [inline] reiserfs_write_end+0x640/0x800 fs/reiserfs/inode.c:2958 generic_perform_write+0x384/0x55c mm/filemap.c:3828 __generic_file_write_iter+0x168/0x388 mm/filemap.c:3945 generic_file_write_iter+0xb8/0x2b4 mm/filemap.c:3977 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x610/0x914 fs/read_write.c:584 ksys_write+0x15c/0x26c fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:646 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 irq event stamp: 605 hardirqs last enabled at (605): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1366 [inline] hardirqs last enabled at (605): [] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:5004 hardirqs last disabled at (604): [] __schedule+0x2a4/0x1c98 kernel/sched/core.c:6457 softirqs last enabled at (414): [] softirq_handle_end kernel/softirq.c:414 [inline] softirqs last enabled at (414): [] __do_softirq+0xc1c/0xe38 kernel/softirq.c:600 softirqs last disabled at (401): [] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80 ---[ end trace 0000000000000000 ]---