================================================================== BUG: KASAN: use-after-free in leaf_paste_in_buffer+0x578/0x9f0 Read of size 48 at addr ffff0000f616fff0 by task syz.2.227/5254 CPU: 0 PID: 5254 Comm: syz.2.227 Not tainted 6.1.103-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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/0x91c 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:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 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:00000000398113cd refcount:3 mapcount:0 mapping:00000000fd89ab35 index:0x214 pfn:0x13616f memcg:ffff0000cb264000 aops:def_blk_aops ino:700002 flags: 0x5ffc40000002042(referenced|workingset|private|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc40000002042 0000000000000000 dead000000000122 ffff0000c049e010 raw: 0000000000000214 ffff0000dfbed570 00000003ffffffff ffff0000cb264000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000f616ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000f616ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000f6170000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff0000f6170080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff0000f6170100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== REISERFS error (device loop2): vs-4010 is_reusable: block number is out of range 11822 (1024) REISERFS (device loop2): Remounting filesystem read-only REISERFS error (device loop2): vs-4010 is_reusable: block number is out of range 262180 (1024) REISERFS error (device loop2): vs-4010 is_reusable: block number is out of range 589868 (1024) REISERFS error (device loop2): vs-4080 _reiserfs_free_block: block 1: bit already cleared ------------[ cut here ]------------ WARNING: CPU: 0 PID: 5254 at fs/reiserfs/journal.c:3397 journal_end+0x1a4/0x260 Modules linked in: CPU: 0 PID: 5254 Comm: syz.2.227 Tainted: G B 6.1.103-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : journal_end+0x1a4/0x260 lr : journal_end+0x1a0/0x260 sp : ffff80001faf75c0 x29: ffff80001faf75c0 x28: dfff800000000000 x27: 1ffff00003f5eed2 x26: 1fffe0001a2b7ca8 x25: 1ffff00003f5eed0 x24: dfff800000000000 x23: ffff80001faf7680 x22: 0000000000000000 x21: ffff80001faf7694 x20: ffff0000d15be540 x19: ffff80001faf7680 x18: ffff80001faf6d7e x17: ffff8000159bd000 x16: ffff8000121d72c0 x15: 0000000000000002 x14: 0000000000006000 x13: ffff0000d15bd340 x12: 0000000000040000 x11: 000000000003710f x10: ffff800020569000 x9 : ffff800008dbe874 x8 : 0000000000037110 x7 : 0000000000000000 x6 : ffff800008dd8a58 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/0x91c 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:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 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: 46861 hardirqs last enabled at (46861): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline] hardirqs last enabled at (46861): [] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:5000 hardirqs last disabled at (46860): [] __schedule+0x2a4/0x1d44 kernel/sched/core.c:6456 softirqs last enabled at (46130): [] softirq_handle_end kernel/softirq.c:414 [inline] softirqs last enabled at (46130): [] handle_softirqs+0xb84/0xd58 kernel/softirq.c:599 softirqs last disabled at (46121): [] __do_softirq+0x14/0x20 kernel/softirq.c:605 ---[ end trace 0000000000000000 ]---