================================================================== BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x6c9/0x920 kernel/bpf/stackmap.c:274 Write of size 32 at addr ffff88807919a660 by task syz.0.31/4488 CPU: 0 PID: 4488 Comm: syz.0.31 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0x188/0x24e 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 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x235/0x290 mm/kasan/generic.c:189 memcpy+0x3c/0x60 mm/kasan/shadow.c:66 __bpf_get_stackid+0x6c9/0x920 kernel/bpf/stackmap.c:274 ____bpf_get_stackid_pe kernel/bpf/stackmap.c:377 [inline] bpf_get_stackid_pe+0x2ec/0x400 kernel/bpf/stackmap.c:334 bpf_prog_ee169d054574282b+0x24/0x39 bpf_dispatcher_nop_func include/linux/bpf.h:1012 [inline] __bpf_prog_run include/linux/filter.h:607 [inline] bpf_prog_run include/linux/filter.h:614 [inline] bpf_overflow_handler+0x50b/0x790 kernel/events/core.c:10321 __perf_event_overflow+0x457/0x630 kernel/events/core.c:9496 perf_event_overflow kernel/events/core.c:9517 [inline] perf_swevent_hrtimer+0x472/0x630 kernel/events/core.c:10967 __run_hrtimer kernel/time/hrtimer.c:1751 [inline] __hrtimer_run_queues+0x4e7/0xc90 kernel/time/hrtimer.c:1815 hrtimer_interrupt+0x399/0x980 kernel/time/hrtimer.c:1877 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1107 [inline] __sysvec_apic_timer_interrupt+0x153/0x5a0 arch/x86/kernel/apic/apic.c:1124 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline] sysvec_apic_timer_interrupt+0x4d/0xc0 arch/x86/kernel/apic/apic.c:1118 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691 RIP: 0033:0x7fff5fffe954 Code: b8 01 00 00 00 89 f9 d3 e0 a9 83 08 00 00 0f 84 ef 00 00 00 4c 8d 35 3b b7 ff ff 41 89 fc 49 c1 e4 04 4b 8d 5c 26 20 45 8b 3e <41> f6 c7 01 75 3b 41 8b 46 04 83 f8 01 75 44 0f 01 f9 66 90 48 c1 RSP: 002b:00007fff5fff6920 EFLAGS: 00000202 RAX: 0000000000000002 RBX: 00007fff5fffa0b0 RCX: 0000000000000001 RDX: 00007f29be8b9360 RSI: 00007fff5fff69e0 RDI: 0000000000000001 RBP: 00007fff5fff6960 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000010 R13: 00007f29bea15fac R14: 00007fff5fffa080 R15: 0000000000004af6 Allocated by task 4488: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:53 ____kasan_kmalloc mm/kasan/common.c:375 [inline] __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:936 [inline] __kmalloc_node+0xb2/0x240 mm/slab_common.c:943 kmalloc_node include/linux/slab.h:589 [inline] __bpf_map_area_alloc kernel/bpf/syscall.c:328 [inline] bpf_map_area_alloc+0x47/0xe0 kernel/bpf/syscall.c:341 prealloc_elems_and_freelist+0x86/0x1c0 kernel/bpf/stackmap.c:51 stack_map_alloc+0x386/0x510 kernel/bpf/stackmap.c:117 find_and_alloc_map kernel/bpf/syscall.c:133 [inline] map_create+0x524/0xff0 kernel/bpf/syscall.c:1149 __sys_bpf+0x38b/0x780 kernel/bpf/syscall.c:5013 __do_sys_bpf kernel/bpf/syscall.c:5135 [inline] __se_sys_bpf kernel/bpf/syscall.c:5133 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5133 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 Last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:46 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486 call_rcu+0x14f/0x950 kernel/rcu/tree.c:2849 nf_hook_entries_free net/netfilter/core.c:88 [inline] __nf_register_net_hook+0x787/0x910 net/netfilter/core.c:445 nf_register_net_hook+0xae/0x190 net/netfilter/core.c:566 nf_register_net_hooks+0x40/0x1a0 net/netfilter/core.c:582 ip6t_register_table+0x51c/0x7c0 net/ipv6/netfilter/ip6_tables.c:1786 ip6table_mangle_table_init+0x3d/0x60 net/ipv6/netfilter/ip6table_mangle.c:84 xt_find_table_lock+0x220/0x360 net/netfilter/x_tables.c:1282 xt_request_find_table_lock+0x22/0x100 net/netfilter/x_tables.c:1307 get_info net/ipv6/netfilter/ip6_tables.c:979 [inline] do_ip6t_get_ctl+0x5e8/0x11c0 net/ipv6/netfilter/ip6_tables.c:1667 nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x22f/0x2e0 net/ipv6/ipv6_sockglue.c:1512 __sys_getsockopt+0x1b0/0x230 net/socket.c:2332 __do_sys_getsockopt net/socket.c:2347 [inline] __se_sys_getsockopt net/socket.c:2344 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2344 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 ffff88807919a600 which belongs to the cache kmalloc-cg-128 of size 128 The buggy address is located 96 bytes inside of 128-byte region [ffff88807919a600, ffff88807919a680) The buggy address belongs to the physical page: page:ffffea0001e46680 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807919aa00 pfn:0x7919a memcg:ffff88807bbdb901 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00016fd480 dead000000000002 ffff888017442a00 raw: ffff88807919aa00 000000008010000f 00000001ffffffff ffff88807bbdb901 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 4365, tgid 4365 (syz-executor), ts 90848280973, free_ts 90848102776 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2560 prep_new_page mm/page_alloc.c:2567 [inline] get_page_from_freelist+0x206b/0x2180 mm/page_alloc.c:4358 __alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5658 alloc_slab_page+0x5d/0x180 mm/slub.c:1799 allocate_slab mm/slub.c:1944 [inline] new_slab+0x87/0x2d0 mm/slub.c:1997 ___slab_alloc+0xbc5/0x1240 mm/slub.c:3154 __slab_alloc mm/slub.c:3240 [inline] slab_alloc_node mm/slub.c:3325 [inline] __kmem_cache_alloc_node+0x126/0x270 mm/slub.c:3398 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc_node+0xa2/0x240 mm/slab_common.c:943 kmalloc_node include/linux/slab.h:589 [inline] kvmalloc_node+0x6c/0x180 mm/util.c:581 kvmalloc include/linux/slab.h:716 [inline] kvzalloc include/linux/slab.h:724 [inline] allocate_hook_entries_size net/netfilter/core.c:61 [inline] nf_hook_entries_grow+0x31a/0x760 net/netfilter/core.c:128 __nf_register_net_hook+0x2c9/0x910 net/netfilter/core.c:423 nf_register_net_hook+0xae/0x190 net/netfilter/core.c:566 nf_register_net_hooks+0x40/0x1a0 net/netfilter/core.c:582 ipt_register_table+0x516/0x7b0 net/ipv4/netfilter/ip_tables.c:1780 iptable_mangle_table_init+0x3d/0x60 net/ipv4/netfilter/iptable_mangle.c:91 xt_find_table_lock+0x220/0x360 net/netfilter/x_tables.c:1282 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1487 [inline] free_pcp_prepare mm/page_alloc.c:1537 [inline] free_unref_page_prepare+0x8e5/0x9e0 mm/page_alloc.c:3414 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3509 __vunmap+0x874/0xa40 mm/vmalloc.c:2726 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:866 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1022 [inline] do_ipt_get_ctl+0xe89/0x11a0 net/ipv4/netfilter/ip_tables.c:1667 nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x19b/0x230 net/ipv4/ip_sockglue.c:1826 __sys_getsockopt+0x1b0/0x230 net/socket.c:2332 __do_sys_getsockopt net/socket.c:2347 [inline] __se_sys_getsockopt net/socket.c:2344 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2344 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: ffff88807919a500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807919a580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807919a600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc ^ ffff88807919a680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807919a700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc ==================================================================