loop3: detected capacity change from 0 to 128 attempt to access beyond end of device loop3: rw=0, want=6491538, limit=128 Buffer I/O error on dev loop3, logical block 3245768, async page read ================================================================== BUG: KASAN: use-after-free in sysv_new_inode+0x10b4/0x1240 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff88805a7b01ce by task syz.3.40/4483 CPU: 0 PID: 4483 Comm: syz.3.40 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:0x7f6b127df969 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:00007f6b10647038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f6b12a06fa0 RCX: 00007f6b127df969 RDX: 000000000000275a RSI: 0000200000000080 RDI: ffffffffffffff9c RBP: 00007f6b12861ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f6b12a06fa0 R15: 00007ffe88e7c638 The buggy address belongs to the page: page:ffffea000169ec00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x5a7b0 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea000169ec48 ffffea000169ebc8 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 0x1100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 4454, ts 105808255873, free_ts 106503574171 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 __clear_user arch/x86/lib/usercopy_64.c:24 [inline] clear_user+0xf0/0x150 arch/x86/lib/usercopy_64.c:54 iov_iter_zero+0x1ed/0xea0 lib/iov_iter.c:956 read_iter_zero+0x6f/0x200 drivers/char/mem.c:492 do_iter_readv_writev+0x497/0x600 fs/read_write.c:-1 do_iter_read+0x20b/0x7c0 fs/read_write.c:790 vfs_readv fs/read_write.c:910 [inline] do_preadv+0x1f9/0x330 fs/read_write.c:1002 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+0xc5/0x170 mm/mmu_gather.c:247 zap_pte_range mm/memory.c:1456 [inline] zap_pmd_range mm/memory.c:1505 [inline] zap_pud_range mm/memory.c:1534 [inline] zap_p4d_range mm/memory.c:1555 [inline] unmap_page_range+0x2096/0x2520 mm/memory.c:1576 unmap_vmas+0x11b/0x230 mm/memory.c:1653 exit_mmap+0x38f/0x5f0 mm/mmap.c:3204 __mmput+0x115/0x3b0 kernel/fork.c:1127 exit_mm+0x567/0x6c0 kernel/exit.c:550 do_exit+0x599/0x20a0 kernel/exit.c:861 do_group_exit+0x12e/0x300 kernel/exit.c:996 get_signal+0x6ca/0x12c0 kernel/signal.c:2900 arch_do_signal_or_restart+0xc1/0x1300 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 Memory state around the buggy address: ffff88805a7b0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805a7b0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805a7b0180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805a7b0200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805a7b0280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================