================================================================== BUG: KASAN: vmalloc-out-of-bounds in vrealloc_noprof+0x340/0x3a0 mm/vmalloc.c:4095 Write of size 2097120 at addr ffffc9001b200020 by task syz.2.2815/19644 CPU: 0 UID: 0 PID: 19644 Comm: syz.2.2815 Not tainted 6.12.0-syzkaller-11930-g0e287d31b62b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memset+0x23/0x50 mm/kasan/shadow.c:84 vrealloc_noprof+0x340/0x3a0 mm/vmalloc.c:4095 push_insn_history+0x16c/0x6a0 kernel/bpf/verifier.c:3571 check_mem_access+0xf30/0x2240 kernel/bpf/verifier.c:7267 do_check+0x7d97/0xfcd0 kernel/bpf/verifier.c:18703 do_check_common+0x1564/0x2010 kernel/bpf/verifier.c:21848 do_check_main kernel/bpf/verifier.c:21939 [inline] bpf_check+0x19380/0x1f1b0 kernel/bpf/verifier.c:22656 bpf_prog_load+0x1667/0x20f0 kernel/bpf/syscall.c:2947 __sys_bpf+0x4ee/0x810 kernel/bpf/syscall.c:5790 __do_sys_bpf kernel/bpf/syscall.c:5897 [inline] __se_sys_bpf kernel/bpf/syscall.c:5895 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5895 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fce25580849 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:00007fce26401058 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007fce25745fa0 RCX: 00007fce25580849 RDX: 0000000000000090 RSI: 0000000020000840 RDI: 0000000000000005 RBP: 00007fce255f3986 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fce25745fa0 R15: 00007ffed925f018 The buggy address belongs to the virtual mapping at [ffffc9001ae00000, ffffc9001b401000) created by: kvrealloc_noprof+0xc7/0x120 mm/util.c:747 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x45b4 pfn:0x81200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 00000000000045b4 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102cc2(GFP_HIGHUSER|__GFP_NOWARN), pid 19644, tgid 19643 (syz.2.2815), ts 948953583059, free_ts 915452661641 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3474 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 vm_area_alloc_pages mm/vmalloc.c:3589 [inline] __vmalloc_area_node mm/vmalloc.c:3667 [inline] __vmalloc_node_range_noprof+0x9c9/0x1380 mm/vmalloc.c:3844 __kvmalloc_node_noprof+0x142/0x190 mm/util.c:672 kvrealloc_noprof+0xc7/0x120 mm/util.c:747 push_insn_history+0x16c/0x6a0 kernel/bpf/verifier.c:3571 check_mem_access+0xf30/0x2240 kernel/bpf/verifier.c:7267 do_check+0x7d97/0xfcd0 kernel/bpf/verifier.c:18703 do_check_common+0x1564/0x2010 kernel/bpf/verifier.c:21848 do_check_main kernel/bpf/verifier.c:21939 [inline] bpf_check+0x19380/0x1f1b0 kernel/bpf/verifier.c:22656 bpf_prog_load+0x1667/0x20f0 kernel/bpf/syscall.c:2947 __sys_bpf+0x4ee/0x810 kernel/bpf/syscall.c:5790 __do_sys_bpf kernel/bpf/syscall.c:5897 [inline] __se_sys_bpf kernel/bpf/syscall.c:5895 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5895 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 page last free pid 10799 tgid 10799 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xf62/0x1a90 mm/page_alloc.c:2704 folios_put_refs+0x76c/0x860 mm/swap.c:962 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x64c/0x1cf0 mm/shmem.c:1040 shmem_truncate_range mm/shmem.c:1152 [inline] shmem_evict_inode+0x29b/0xa80 mm/shmem.c:1280 evict+0x4ea/0x9a0 fs/inode.c:796 do_unlinkat+0x512/0x830 fs/namei.c:4594 __do_sys_unlink fs/namei.c:4635 [inline] __se_sys_unlink fs/namei.c:4633 [inline] __x64_sys_unlink+0x47/0x50 fs/namei.c:4633 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffffc9001b1fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9001b1fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc9001b200000: 00 00 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ^ ffffc9001b200080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ffffc9001b200100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ==================================================================