syz.2.757: attempt to access beyond end of device loop2: rw=0, sector=6491536, nr_sectors = 2 limit=128 Buffer I/O error on dev loop2, 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 ffff8880426801ce by task syz.2.757/8099 CPU: 0 PID: 8099 Comm: syz.2.757 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/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/0x210 mm/kasan/report.c:420 kasan_report+0x10b/0x140 mm/kasan/report.c:524 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:0x7fd1af98eba9 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:00007fd1b0807038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fd1afbd6090 RCX: 00007fd1af98eba9 RDX: 0000000000002d41 RSI: 0000200000000340 RDI: ffffffffffffff9c RBP: 00007fd1afa11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000000d5 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fd1afbd6128 R14: 00007fd1afbd6090 R15: 00007ffc57394a88 The buggy address belongs to the physical page: page:ffffea000109a000 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x42680 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001154008 ffffea00011da008 0000000000000000 raw: 0000000000000001 0000000000000007 00000000ffffff7f 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 8007, tgid 8006 (syz.0.741), ts 452174791659, free_ts 453258888393 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 shmem_alloc_folio mm/shmem.c:1589 [inline] shmem_alloc_and_acct_folio+0x42e/0xb60 mm/shmem.c:1613 shmem_get_folio_gfp+0x1361/0x3400 mm/shmem.c:1941 shmem_get_folio mm/shmem.c:2072 [inline] shmem_write_begin+0xee/0x3f0 mm/shmem.c:2556 generic_perform_write+0x2db/0x560 mm/filemap.c:3846 __generic_file_write_iter+0x172/0x430 mm/filemap.c:3974 generic_file_write_iter+0xab/0x2e0 mm/filemap.c:4006 do_iter_readv_writev fs/read_write.c:-1 [inline] do_iter_write+0x62d/0xaf0 fs/read_write.c:861 iter_file_splice_write+0x665/0xc50 fs/splice.c:685 do_splice_from fs/splice.c:763 [inline] direct_splice_actor+0xe1/0x130 fs/splice.c:950 splice_direct_to_actor+0x480/0xb60 fs/splice.c:896 do_splice_direct+0x1b0/0x2b0 fs/splice.c:1002 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 release_pages+0x1f92/0x2200 mm/swap.c:1035 __pagevec_release+0x6d/0xe0 mm/swap.c:1055 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] shmem_undo_range+0x75b/0x2050 mm/shmem.c:946 shmem_truncate_range mm/shmem.c:1062 [inline] shmem_evict_inode+0x248/0xa40 mm/shmem.c:1171 evict+0x485/0x870 fs/inode.c:705 do_unlinkat+0x377/0x560 fs/namei.c:4397 __do_sys_unlink fs/namei.c:4438 [inline] __se_sys_unlink fs/namei.c:4436 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4436 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: ffff888042680080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888042680100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888042680180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888042680200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888042680280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================