================================================================== BUG: KASAN: use-after-free in inode2sd+0x924/0x990 fs/reiserfs/inode.c:1378 Write of size 2 at addr ffff888065fb4648 by task syz.4.917/7438 CPU: 1 PID: 7438 Comm: syz.4.917 Not tainted 5.15.184-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x41/0x5e lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:451 inode2sd+0x924/0x990 fs/reiserfs/inode.c:1378 update_stat_data fs/reiserfs/inode.c:1439 [inline] reiserfs_update_sd_size+0x632/0xa80 fs/reiserfs/inode.c:1505 reiserfs_update_sd fs/reiserfs/reiserfs.h:3099 [inline] reiserfs_do_truncate+0x71e/0xea0 fs/reiserfs/stree.c:2036 reiserfs_truncate_file+0x179/0xa20 fs/reiserfs/inode.c:2318 reiserfs_setattr+0x877/0xd20 fs/reiserfs/inode.c:3409 notify_change+0x4b4/0xea0 fs/attr.c:505 do_truncate+0xee/0x1a0 fs/open.c:65 handle_truncate fs/namei.c:3265 [inline] do_open fs/namei.c:3612 [inline] path_openat+0x173d/0x2360 fs/namei.c:3742 do_filp_open+0x199/0x3d0 fs/namei.c:3769 do_sys_openat2+0x11e/0x400 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_creat fs/open.c:1345 [inline] __se_sys_creat fs/open.c:1339 [inline] __x64_sys_creat+0xc3/0x110 fs/open.c:1339 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x33/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f0922cb2ff9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0922734038 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f0922e6af80 RCX: 00007f0922cb2ff9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000940 RBP: 00007f0922d25296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f0922e6af80 R15: 00007fff2133cd68 The buggy address belongs to the page: page:ffffea000197ed00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x65fb4 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00018a5ec8 ffffea00018aa448 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 0x1100cca(GFP_HIGHUSER_MOVABLE), pid 7409, ts 250770485870, free_ts 251610939601 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1369/0x31f0 mm/page_alloc.c:4192 __alloc_pages+0x1b2/0x440 mm/page_alloc.c:5466 alloc_pages_vma+0xe0/0x650 mm/mempolicy.c:2146 shmem_alloc_page+0x111/0x1c0 mm/shmem.c:1586 shmem_alloc_and_acct_page+0xff/0x730 mm/shmem.c:1611 shmem_getpage_gfp+0x4d1/0x19b0 mm/shmem.c:1906 shmem_getpage mm/shmem.c:151 [inline] shmem_write_begin+0xcc/0x1a0 mm/shmem.c:2474 generic_perform_write+0x1d6/0x430 mm/filemap.c:3785 __generic_file_write_iter+0x2f0/0x560 mm/filemap.c:3912 generic_file_write_iter+0xb9/0x1c0 mm/filemap.c:3944 call_write_iter include/linux/fs.h:2172 [inline] new_sync_write+0x35d/0x5f0 fs/read_write.c:507 vfs_write+0x577/0x7e0 fs/read_write.c:594 ksys_write+0xf4/0x1d0 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x33/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare+0x379/0x850 mm/page_alloc.c:1391 free_unref_page_prepare mm/page_alloc.c:3317 [inline] free_unref_page_list+0x16f/0xbd0 mm/page_alloc.c:3433 release_pages+0xb3a/0x1480 mm/swap.c:963 __pagevec_release+0x59/0xe0 mm/swap.c:983 pagevec_release include/linux/pagevec.h:81 [inline] shmem_undo_range+0x507/0xec0 mm/shmem.c:964 shmem_truncate_range mm/shmem.c:1063 [inline] shmem_evict_inode+0x313/0xa40 mm/shmem.c:1145 evict+0x322/0x770 fs/inode.c:647 __dentry_kill+0x315/0x5e0 fs/dcache.c:586 __fput+0x2f1/0x9a0 fs/file_table.c:319 task_work_run+0xb8/0x140 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:181 [inline] exit_to_user_mode_prepare+0x15d/0x160 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x12/0x30 kernel/entry/common.c:307 do_syscall_64+0x40/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff888065fb4500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888065fb4580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888065fb4600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888065fb4680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888065fb4700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================