VFS: Found a Xenix FS (block size = 1024) on device loop1 ================================================================== BUG: KASAN: use-after-free in sysv_new_inode+0x10b4/0x1240 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff8880503ab1ce by task syz.1.439/6142 CPU: 0 PID: 6142 Comm: syz.1.439 Not tainted 5.15.182-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 sysv_new_inode+0x10b4/0x1240 fs/sysv/ialloc.c:153 sysv_mknod+0x4a/0xd0 fs/sysv/namei.c:53 lookup_open fs/namei.c:3462 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0x11e1/0x2f30 fs/namei.c:3739 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f9a0c2b3969 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:00007f9a0a0fa038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f9a0c4db080 RCX: 00007f9a0c2b3969 RDX: 000000000000275a RSI: 0000200000000080 RDI: ffffffffffffff9c RBP: 00007f9a0c335ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9a0c4db080 R15: 00007ffdc1106238 The buggy address belongs to the page: page:ffffea000140eac0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x100 pfn:0x503ab flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea000140eb08 ffffea000140ea88 0000000000000000 raw: 0000000000000100 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 0x1100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 4911, ts 215286116188, free_ts 215510106251 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5466 alloc_pages_vma+0x393/0x7c0 mm/mempolicy.c:2146 do_anonymous_page mm/memory.c:3838 [inline] handle_pte_fault mm/memory.c:4648 [inline] __handle_mm_fault mm/memory.c:4785 [inline] handle_mm_fault+0x2382/0x43c0 mm/memory.c:4883 do_user_addr_fault+0x489/0xc80 arch/x86/mm/fault.c:1357 handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:205 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] copyout lib/iov_iter.c:157 [inline] copy_page_to_iter_iovec lib/iov_iter.c:228 [inline] __copy_page_to_iter lib/iov_iter.c:861 [inline] copy_page_to_iter+0x49e/0x910 lib/iov_iter.c:889 filemap_read+0x1d94/0x2480 mm/filemap.c:2698 blkdev_read_iter+0x11d/0x150 block/fops.c:560 call_read_iter include/linux/fs.h:2166 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0x725/0xcf0 fs/read_write.c:485 ksys_read+0x14d/0x250 fs/read_write.c:623 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 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 mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page_list+0x122/0x7e0 mm/page_alloc.c:3433 release_pages+0x184b/0x1bb0 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x164/0x2e0 mm/mmu_gather.c:338 unmap_region+0x315/0x360 mm/mmap.c:2657 __do_munmap+0x9d3/0xdc0 mm/mmap.c:2887 __vm_munmap+0x137/0x230 mm/mmap.c:2940 __do_sys_munmap mm/mmap.c:2966 [inline] __se_sys_munmap mm/mmap.c:2962 [inline] __x64_sys_munmap+0x67/0x70 mm/mmap.c:2962 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff8880503ab080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880503ab100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880503ab180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880503ab200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880503ab280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================