loop5: rw=0, sector=6491536, nr_sectors = 2 limit=128 Buffer I/O error on dev loop5, logical block 3245768, async page read ================================================================== BUG: KASAN: use-after-free in sysv_new_inode+0x10d9/0x1270 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff8880746131ce by task syz.5.559/6873 CPU: 1 PID: 6873 Comm: syz.5.559 Not tainted 6.1.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0xa8/0x220 mm/kasan/report.c:427 kasan_report+0x10b/0x140 mm/kasan/report.c:531 sysv_new_inode+0x10d9/0x1270 fs/sysv/ialloc.c:153 sysv_mknod+0x4a/0xd0 fs/sysv/namei.c:53 lookup_open fs/namei.c:3482 [inline] open_last_lookups fs/namei.c:3550 [inline] path_openat+0x1187/0x2e70 fs/namei.c:3780 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1345 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f708858e929 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:00007f70894be038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f70887b5fa0 RCX: 00007f708858e929 RDX: 0000000000143041 RSI: 0000200000000680 RDI: ffffffffffffff9c RBP: 00007f7088610b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f70887b5fa0 R15: 00007fffb637c3e8 The buggy address belongs to the physical page: page:ffffea0001d184c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x74613 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 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 6711, tgid 6703 (syz.0.516), ts 254711300196, free_ts 256718805356 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614 __folio_alloc+0xe/0x30 mm/page_alloc.c:5646 vma_alloc_folio+0x4a3/0x900 mm/mempolicy.c:2243 alloc_page_vma include/linux/gfp.h:284 [inline] do_cow_fault mm/memory.c:4650 [inline] do_fault mm/memory.c:4762 [inline] handle_pte_fault mm/memory.c:5031 [inline] __handle_mm_fault mm/memory.c:5173 [inline] handle_mm_fault+0x19ab/0x3e70 mm/memory.c:5294 faultin_page mm/gup.c:1026 [inline] __get_user_pages+0x3ff/0xeb0 mm/gup.c:1250 populate_vma_page_range+0x214/0x2b0 mm/gup.c:1607 __mm_populate+0x248/0x370 mm/gup.c:1721 mm_populate include/linux/mm.h:2823 [inline] vm_mmap_pgoff+0x203/0x2b0 mm/util.c:525 ksys_mmap_pgoff+0x516/0x6f0 mm/mmap.c:1470 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare mm/page_alloc.c:1509 [inline] free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384 free_unref_page_list+0xbb/0x8e0 mm/page_alloc.c:3525 shrink_folio_list+0x7146/0x7ae0 mm/vmscan.c:2103 reclaim_folio_list+0x85/0x2e0 mm/vmscan.c:2695 reclaim_pages+0x561/0x670 mm/vmscan.c:2731 madvise_cold_or_pageout_pte_range+0x1819/0x1e50 mm/madvise.c:494 walk_pmd_range mm/pagewalk.c:128 [inline] walk_pud_range mm/pagewalk.c:205 [inline] walk_p4d_range mm/pagewalk.c:240 [inline] walk_pgd_range+0xbbc/0x13c0 mm/pagewalk.c:277 __walk_page_range+0x133/0x590 mm/pagewalk.c:379 walk_page_range+0x3a2/0x570 mm/pagewalk.c:477 madvise_pageout_page_range mm/madvise.c:552 [inline] madvise_pageout mm/madvise.c:589 [inline] madvise_vma_behavior mm/madvise.c:1030 [inline] madvise_walk_vmas mm/madvise.c:1259 [inline] do_madvise+0x1b36/0x33d0 mm/madvise.c:1438 __do_sys_madvise mm/madvise.c:1451 [inline] __se_sys_madvise mm/madvise.c:1449 [inline] __x64_sys_madvise+0xa2/0xb0 mm/madvise.c:1449 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff888074613080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888074613100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888074613180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888074613200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888074613280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================