REISERFS (device loop3): checking transaction log (loop3) REISERFS (device loop3): Using r5 hash to sort names REISERFS (device loop3): Created .reiserfs_priv - reserved for xattr storage. ================================================================== BUG: KASAN: use-after-free in leaf_paste_entries+0x1120/0x13a0 Read of size 2 at addr ffff888033b34c98 by task syz-executor.3/6296 CPU: 1 PID: 6296 Comm: syz-executor.3 Not tainted 6.2.0-rc6-syzkaller-00239-g0136d86b7852 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Call Trace: dump_stack_lvl+0x1b5/0x2a0 print_report+0x163/0x4c0 kasan_report+0xce/0x100 leaf_paste_entries+0x1120/0x13a0 leaf_copy_dir_entries+0x7b5/0xbe0 leaf_copy_boundary_item+0xbbe/0x21b0 leaf_move_items+0xcd4/0x1370 leaf_shift_left+0xbe/0x430 balance_leaf+0x2132/0x121d0 do_balance+0x2e5/0x8d0 reiserfs_cut_from_item+0x1963/0x25a0 reiserfs_do_truncate+0x988/0x1550 reiserfs_truncate_file+0x463/0x790 reiserfs_setattr+0xce1/0x1290 notify_change+0xdd1/0x1080 do_truncate+0x207/0x2f0 path_openat+0x278f/0x2e30 do_filp_open+0x26d/0x500 do_sys_openat2+0x128/0x4f0 __x64_sys_creat+0x123/0x160 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f232408c0c9 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:00007f2324dae168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f23241abf80 RCX: 00007f232408c0c9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007f23240e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe8e0a2ccf R14: 00007f2324dae300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea0000cecd00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x33b34 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000cecd48 ffffea0000c032c8 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 6231, tgid 6223 (syz-executor.5), ts 203530320858, free_ts 205131837096 get_page_from_freelist+0x3403/0x3580 __alloc_pages+0x291/0x7e0 __folio_alloc+0x13/0x30 vma_alloc_folio+0x48a/0x9a0 shmem_alloc_and_acct_folio+0x596/0xd40 shmem_get_folio_gfp+0x1408/0x34a0 shmem_write_begin+0x147/0x4c0 generic_perform_write+0x2ca/0x5c0 __generic_file_write_iter+0x17a/0x400 generic_file_write_iter+0xaf/0x310 vfs_write+0x7dd/0xc50 ksys_write+0x17c/0x2a0 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: free_unref_page_prepare+0xf3a/0x1040 free_unref_page_list+0x6b1/0x950 release_pages+0x2196/0x2470 __pagevec_release+0x84/0x100 shmem_undo_range+0x698/0x1db0 shmem_evict_inode+0x263/0x9d0 evict+0x2a4/0x620 __dentry_kill+0x436/0x650 dentry_kill+0xbb/0x290 dput+0x1d8/0x3f0 __fput+0x5e4/0x890 task_work_run+0x24a/0x300 exit_to_user_mode_loop+0xd1/0xf0 exit_to_user_mode_prepare+0xb1/0x140 syscall_exit_to_user_mode+0x54/0x2d0 do_syscall_64+0x4d/0xc0 Memory state around the buggy address: ffff888033b34b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888033b34c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888033b34c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888033b34d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888033b34d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================