================================================================== BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x677/0xcf0 kernel/bpf/stackmap.c:265 Write of size 8 at addr ffff88804d82d658 by task syz.3.1014/9956 CPU: 0 UID: 0 PID: 9956 Comm: syz.3.1014 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 __bpf_get_stackid+0x677/0xcf0 kernel/bpf/stackmap.c:265 ____bpf_get_stackid_raw_tp kernel/trace/bpf_trace.c:1810 [inline] bpf_get_stackid_raw_tp+0x196/0x210 kernel/trace/bpf_trace.c:1799 bpf_prog_12712c88fd19bd5b+0x2a/0x32 bpf_dispatcher_nop_func include/linux/bpf.h:1335 [inline] __bpf_prog_run include/linux/filter.h:718 [inline] bpf_prog_run include/linux/filter.h:725 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2257 [inline] bpf_trace_run4+0x28b/0x4a0 kernel/trace/bpf_trace.c:2300 __do_trace_mm_page_alloc include/trace/events/kmem.h:177 [inline] trace_mm_page_alloc+0x129/0x150 include/trace/events/kmem.h:177 __alloc_frozen_pages_noprof+0x1d6/0x370 mm/page_alloc.c:5170 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline] alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2507 get_free_pages_noprof+0xf/0x80 mm/page_alloc.c:5207 __kasan_populate_vmalloc mm/kasan/shadow.c:362 [inline] kasan_populate_vmalloc+0x33/0x1a0 mm/kasan/shadow.c:417 alloc_vmap_area+0xd51/0x1490 mm/vmalloc.c:2092 __get_vm_area_node+0x1f8/0x300 mm/vmalloc.c:3187 __vmalloc_node_range_noprof+0x301/0x12f0 mm/vmalloc.c:3853 __vmalloc_node_noprof mm/vmalloc.c:3956 [inline] vmalloc_noprof+0xb2/0xf0 mm/vmalloc.c:3989 bpf_prog_calc_tag+0xa7/0x440 kernel/bpf/core.c:303 resolve_pseudo_ldimm64+0xbc/0xc50 kernel/bpf/verifier.c:20550 bpf_check+0x1c58/0x1d2e0 kernel/bpf/verifier.c:24692 bpf_prog_load+0x1318/0x1930 kernel/bpf/syscall.c:2979 __sys_bpf+0x528/0x870 kernel/bpf/syscall.c:6029 __do_sys_bpf kernel/bpf/syscall.c:6139 [inline] __se_sys_bpf kernel/bpf/syscall.c:6137 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6137 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4e1e78ebe9 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:00007f4e1f51e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f4e1e9b5fa0 RCX: 00007f4e1e78ebe9 RDX: 0000000000000080 RSI: 0000200000000180 RDI: 0000000000000005 RBP: 00007f4e1e811e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f4e1e9b6038 R14: 00007f4e1e9b5fa0 R15: 00007fff314e7718 Allocated by task 9956: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4365 [inline] __kmalloc_node_noprof+0x276/0x4e0 mm/slub.c:4371 kmalloc_node_noprof include/linux/slab.h:932 [inline] __bpf_map_area_alloc kernel/bpf/syscall.c:393 [inline] bpf_map_area_alloc+0x64/0x180 kernel/bpf/syscall.c:406 prealloc_elems_and_freelist+0x86/0x1d0 kernel/bpf/stackmap.c:51 stack_map_alloc+0x33f/0x4c0 kernel/bpf/stackmap.c:114 map_create+0xaa0/0x14d0 kernel/bpf/syscall.c:1480 __sys_bpf+0x60f/0x870 kernel/bpf/syscall.c:6011 __do_sys_bpf kernel/bpf/syscall.c:6139 [inline] __se_sys_bpf kernel/bpf/syscall.c:6137 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6137 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88804d82d000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 24 bytes to the right of allocated 1600-byte region [ffff88804d82d000, ffff88804d82d640) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4d828 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888031fc3501 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a44b3c0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000080008 00000000f5000000 ffff888031fc3501 head: 00fff00000000040 ffff88801a44b3c0 dead000000000122 0000000000000000 head: 0000000000000000 0000000000080008 00000000f5000000 ffff888031fc3501 head: 00fff00000000003 ffffea0001360a01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5866, tgid 5866 (syz-executor), ts 291058123697, free_ts 290941221525 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __do_kmalloc_node mm/slub.c:4364 [inline] __kvmalloc_node_noprof+0x429/0x5f0 mm/slub.c:5052 kvmalloc_array_node_noprof include/linux/slab.h:1065 [inline] alloc_fdtable+0xfc/0x2c0 fs/file.c:219 dup_fd+0x86c/0xb60 fs/file.c:420 copy_files+0xc9/0x120 kernel/fork.c:1591 copy_process+0x15b2/0x3c00 kernel/fork.c:2163 kernel_clone+0x21e/0x840 kernel/fork.c:2605 __do_sys_clone kernel/fork.c:2748 [inline] __se_sys_clone kernel/fork.c:2732 [inline] __x64_sys_clone+0x18b/0x1e0 kernel/fork.c:2732 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 9922 tgid 9912 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 __folio_put+0x21b/0x2c0 mm/swap.c:112 put_netmem net/core/skbuff.c:7370 [inline] skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_release_data+0x49a/0x7c0 net/core/skbuff.c:1080 skb_release_all net/core/skbuff.c:1151 [inline] kfree_skb_add_bulk net/core/skbuff.c:1224 [inline] kfree_skb_list_reason+0x25d/0x460 net/core/skbuff.c:1246 skb_release_data+0x61e/0x7c0 net/core/skbuff.c:1084 skb_release_all net/core/skbuff.c:1151 [inline] __kfree_skb net/core/skbuff.c:1165 [inline] sk_skb_reason_drop+0x127/0x170 net/core/skbuff.c:1203 kfree_skb_reason include/linux/skbuff.h:1275 [inline] kfree_skb include/linux/skbuff.h:1284 [inline] kcm_sendmsg+0x3cc/0x2ad0 net/kcm/kcmsock.c:945 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:729 sock_write_iter+0x258/0x330 net/socket.c:1179 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x5c9/0xb30 fs/read_write.c:686 ksys_write+0x145/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88804d82d500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804d82d580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88804d82d600: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff88804d82d680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804d82d700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================