================================================================== BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x6fa/0x960 kernel/bpf/stackmap.c:274 Write of size 96 at addr ffff888118a40010 by task syz.3.75/599 CPU: 1 PID: 599 Comm: syz.3.75 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x71/0x200 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:420 kasan_report+0x122/0x150 mm/kasan/report.c:524 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189 memcpy+0x44/0x70 mm/kasan/shadow.c:66 __bpf_get_stackid+0x6fa/0x960 kernel/bpf/stackmap.c:274 ____bpf_get_stackid_pe kernel/bpf/stackmap.c:365 [inline] bpf_get_stackid_pe+0x2ee/0x400 kernel/bpf/stackmap.c:334 bpf_prog_47bcecfbcadd1995+0x21/0x39 bpf_dispatcher_nop_func include/linux/bpf.h:987 [inline] __bpf_prog_run include/linux/filter.h:607 [inline] bpf_prog_run include/linux/filter.h:614 [inline] bpf_overflow_handler+0x3d0/0x5e0 kernel/events/core.c:10238 __perf_event_overflow+0x437/0x620 kernel/events/core.c:9448 perf_swevent_overflow kernel/events/core.c:9524 [inline] perf_swevent_event+0x2f7/0x530 kernel/events/core.c:-1 do_perf_sw_event kernel/events/core.c:9665 [inline] ___perf_sw_event+0x3bf/0x4f0 kernel/events/core.c:9696 __perf_sw_event+0x134/0x270 kernel/events/core.c:9708 perf_sw_event include/linux/perf_event.h:1250 [inline] do_user_addr_fault+0xffb/0x1050 arch/x86/mm/fault.c:1287 handle_page_fault arch/x86/mm/fault.c:1466 [inline] exc_page_fault+0x51/0xb0 arch/x86/mm/fault.c:1522 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:608 RIP: 0010:fault_in_readable+0xd5/0x150 mm/gup.c:1915 Code: 01 81 c7 ff 4d 89 f4 49 81 cc ff 0f 00 00 4d 89 f7 49 01 dc 49 81 e4 00 f0 ff ff 4d 39 e6 77 3d e8 e0 80 c7 ff 4d 39 e7 74 40 <41> 8a 07 88 45 df 49 81 c7 00 10 00 00 4d 39 e7 74 07 e8 c4 80 c7 RSP: 0018:ffffc9000dfdfa28 EFLAGS: 00050287 RAX: ffffffff81a9eb30 RBX: 0000000000001000 RCX: 0000000000080000 RDX: ffffc90002ed0000 RSI: 00000000000001d1 RDI: 00000000000001d2 RBP: ffffc9000dfdfa50 R08: ffff88811bf59440 R09: 0000000000000002 R10: 0000000000000006 R11: 0000000000000002 R12: 0000200000004000 R13: dffffc0000000000 R14: 0000200000002180 R15: 0000200000003000 fault_in_iov_iter_readable+0xc3/0x320 lib/iov_iter.c:356 generic_perform_write+0x212/0x740 mm/filemap.c:3893 __generic_file_write_iter+0x17a/0x230 mm/filemap.c:4002 generic_file_write_iter+0xae/0x310 mm/filemap.c:4031 call_write_iter include/linux/fs.h:2282 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x603/0xce0 fs/read_write.c:584 ksys_write+0x149/0x250 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:646 x64_sys_call+0x27b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f3c6ef9aeb9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3c6fd85028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f3c6f215fa0 RCX: 00007f3c6ef9aeb9 RDX: 0000000000040010 RSI: 0000200000000180 RDI: 000000000000000d RBP: 00007f3c6f008c1f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f3c6f216038 R14: 00007f3c6f215fa0 R15: 00007ffe9c3e4628 Allocated by task 599: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:53 kasan_save_alloc_info+0x25/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:380 [inline] __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:389 kasan_kmalloc include/linux/kasan.h:212 [inline] __do_kmalloc_node mm/slab_common.c:938 [inline] __kmalloc_node+0xb2/0x1e0 mm/slab_common.c:945 kmalloc_node include/linux/slab.h:589 [inline] __bpf_map_area_alloc kernel/bpf/syscall.c:328 [inline] bpf_map_area_alloc+0x4b/0xe0 kernel/bpf/syscall.c:341 prealloc_elems_and_freelist+0x8a/0x1e0 kernel/bpf/stackmap.c:51 stack_map_alloc+0x3a7/0x530 kernel/bpf/stackmap.c:117 find_and_alloc_map kernel/bpf/syscall.c:133 [inline] map_create+0x49c/0xd80 kernel/bpf/syscall.c:1126 __sys_bpf+0x34e/0x850 kernel/bpf/syscall.c:4987 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5107 x64_sys_call+0x488/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:322 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff888118a40000 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 16 bytes inside of 64-byte region [ffff888118a40000, ffff888118a40040) The buggy address belongs to the physical page: page:ffffea0004629000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x118a40 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff888100042780 raw: 0000000000000000 0000000000200020 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 597, tgid 596 (syz.0.77), ts 33356178935, free_ts 33355571164 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2643 prep_new_page+0x1c/0x110 mm/page_alloc.c:2650 get_page_from_freelist+0x2d12/0x2d80 mm/page_alloc.c:4554 __alloc_pages+0x1d9/0x480 mm/page_alloc.c:5868 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1 allocate_slab mm/slub.c:1967 [inline] new_slab+0x98/0x3d0 mm/slub.c:2020 ___slab_alloc+0x6bd/0xb20 mm/slub.c:3177 __slab_alloc+0x5e/0xa0 mm/slub.c:3263 slab_alloc_node mm/slub.c:3348 [inline] __kmem_cache_alloc_node+0x203/0x2c0 mm/slub.c:3423 __do_kmalloc_node mm/slab_common.c:937 [inline] __kmalloc_node+0xa1/0x1e0 mm/slab_common.c:945 kmalloc_node include/linux/slab.h:589 [inline] kvmalloc_node+0x28a/0x460 mm/util.c:592 kvmalloc include/linux/slab.h:716 [inline] kvmalloc_array include/linux/slab.h:734 [inline] kvcalloc include/linux/slab.h:739 [inline] check_cfg+0x9a/0xf20 kernel/bpf/verifier.c:11154 bpf_check+0x3f00/0x10d10 kernel/bpf/verifier.c:15569 bpf_prog_load+0x10f0/0x16a0 kernel/bpf/syscall.c:2624 __sys_bpf+0x57b/0x850 kernel/bpf/syscall.c:5005 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5107 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1551 [inline] free_pcp_prepare mm/page_alloc.c:1625 [inline] free_unref_page_prepare+0x742/0x750 mm/page_alloc.c:3589 free_unref_page+0x95/0x540 mm/page_alloc.c:3687 free_the_page mm/page_alloc.c:836 [inline] __free_pages+0x67/0x100 mm/page_alloc.c:5957 __vunmap+0x9c0/0xb80 mm/vmalloc.c:2739 __vfree mm/vmalloc.c:2788 [inline] vfree+0x61/0x90 mm/vmalloc.c:2819 bpf_prog_calc_tag+0x558/0x670 kernel/bpf/core.c:343 resolve_pseudo_ldimm64+0xd3/0x1190 kernel/bpf/verifier.c:13025 bpf_check+0x3e06/0x10d10 kernel/bpf/verifier.c:15559 bpf_prog_load+0x10f0/0x16a0 kernel/bpf/syscall.c:2624 __sys_bpf+0x57b/0x850 kernel/bpf/syscall.c:5005 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5107 x64_sys_call+0x488/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:322 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff888118a3ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888118a3ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888118a40000: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ^ ffff888118a40080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888118a40100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 01 81 c7 ff 4d 89 add %eax,-0x76b20039(%rcx) 6: f4 hlt 7: 49 81 cc ff 0f 00 00 or $0xfff,%r12 e: 4d 89 f7 mov %r14,%r15 11: 49 01 dc add %rbx,%r12 14: 49 81 e4 00 f0 ff ff and $0xfffffffffffff000,%r12 1b: 4d 39 e6 cmp %r12,%r14 1e: 77 3d ja 0x5d 20: e8 e0 80 c7 ff call 0xffc78105 25: 4d 39 e7 cmp %r12,%r15 28: 74 40 je 0x6a * 2a: 41 8a 07 mov (%r15),%al <-- trapping instruction 2d: 88 45 df mov %al,-0x21(%rbp) 30: 49 81 c7 00 10 00 00 add $0x1000,%r15 37: 4d 39 e7 cmp %r12,%r15 3a: 74 07 je 0x43 3c: e8 .byte 0xe8 3d: c4 .byte 0xc4 3e: 80 .byte 0x80 3f: c7 .byte 0xc7