attempt to access beyond end of device loop6: rw=0, want=6491538, limit=128 buffer_io_error: 39 callbacks suppressed Buffer I/O error on dev loop6, logical block 3245768, async page read ================================================================== BUG: KASAN: use-after-free in sysv_new_inode+0x1062/0x11f0 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff88807f20f1ce by task syz.6.2182/13764 CPU: 1 PID: 13764 Comm: syz.6.2182 Not tainted 5.15.173-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 sysv_new_inode+0x1062/0x11f0 fs/sysv/ialloc.c:153 sysv_mknod+0x4a/0xe0 fs/sysv/namei.c:53 lookup_open fs/namei.c:3462 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0x130a/0x2f20 fs/namei.c:3739 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_open fs/open.c:1277 [inline] __se_sys_open fs/open.c:1273 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1273 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fe540b0c759 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:00007fe53ef84038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007fe540cc3f80 RCX: 00007fe540b0c759 RDX: 0000000000000000 RSI: 0000000000141042 RDI: 0000000020000000 RBP: 00007fe540b7f75e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe540cc3f80 R15: 00007fffd1455cb8 The buggy address belongs to the page: page:ffffea0001fc83c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x100 pfn:0x7f20f flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 ffffea0001fc8388 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 9, migratetype Movable, gfp_mask 0x1346cca(GFP_HIGHUSER_MOVABLE|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_COMP|__GFP_THISNODE), pid 1, ts 23511384684, free_ts 1104359011294 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192 __alloc_pages+0x272/0x700 mm/page_alloc.c:5464 alloc_buddy_huge_page+0xea/0x1b0 mm/hugetlb.c:1818 alloc_fresh_huge_page+0xf5/0x690 mm/hugetlb.c:1858 alloc_pool_huge_page+0xf3/0x350 mm/hugetlb.c:1894 set_max_huge_pages mm/hugetlb.c:3179 [inline] __nr_hugepages_store_common+0x3ed/0x950 mm/hugetlb.c:3309 hugetlb_sysctl_handler_common mm/hugetlb.c:3933 [inline] hugetlb_sysctl_handler+0x1e8/0x250 mm/hugetlb.c:3943 proc_sys_call_handler+0x541/0x8a0 fs/proc/proc_sysctl.c:585 __kernel_write+0x5b1/0xa60 fs/read_write.c:539 kernel_write+0xcd/0x200 fs/read_write.c:568 process_sysctl_arg+0x3f3/0x640 fs/proc/proc_sysctl.c:1861 parse_one kernel/params.c:153 [inline] parse_args+0x61b/0xda0 kernel/params.c:188 do_sysctl_args+0xe7/0x180 fs/proc/proc_sysctl.c:1893 kernel_init+0x63/0x290 init/main.c:1527 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 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+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 put_page include/linux/mm.h:1247 [inline] huge_pagevec_release fs/hugetlbfs/inode.c:116 [inline] remove_inode_hugepages+0xc47/0x1070 fs/hugetlbfs/inode.c:564 hugetlbfs_evict_inode+0x1f/0x70 fs/hugetlbfs/inode.c:576 evict+0x529/0x930 fs/inode.c:622 __dentry_kill+0x436/0x650 fs/dcache.c:586 dentry_kill+0xbb/0x290 dput+0xd8/0x1a0 fs/dcache.c:893 __fput+0x636/0x8e0 fs/file_table.c:288 task_work_run+0x129/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 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+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff88807f20f080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807f20f100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88807f20f180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807f20f200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807f20f280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================