==================================================================
BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x6c7/0x900 kernel/bpf/stackmap.c:271
Write of size 104 at addr ffff888067906b10 by task syz.4.9907/10598
CPU: 1 PID: 10598 Comm: syz.4.9907 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:468
kasan_report+0x117/0x150 mm/kasan/report.c:581
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x241/0x290 mm/kasan/generic.c:187
__asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106
__bpf_get_stackid+0x6c7/0x900 kernel/bpf/stackmap.c:271
____bpf_get_stackid_pe kernel/bpf/stackmap.c:362 [inline]
bpf_get_stackid_pe+0x343/0x410 kernel/bpf/stackmap.c:331
bpf_prog_282a5593b1ef8d13+0x29/0x3e
bpf_dispatcher_nop_func include/linux/bpf.h:1224 [inline]
__bpf_prog_run include/linux/filter.h:617 [inline]
bpf_prog_run include/linux/filter.h:624 [inline]
bpf_overflow_handler+0x1fc/0x510 kernel/events/core.c:10576
__perf_event_overflow+0x461/0x660 kernel/events/core.c:9712
perf_event_overflow kernel/events/core.c:9733 [inline]
perf_swevent_hrtimer+0x437/0x610 kernel/events/core.c:11222
__run_hrtimer kernel/time/hrtimer.c:1754 [inline]
__hrtimer_run_queues+0x4e8/0xc10 kernel/time/hrtimer.c:1818
hrtimer_interrupt+0x39d/0x980 kernel/time/hrtimer.c:1880
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1077 [inline]
__sysvec_apic_timer_interrupt+0xfb/0x3b0 arch/x86/kernel/apic/apic.c:1094
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
sysvec_apic_timer_interrupt+0x9f/0xc0 arch/x86/kernel/apic/apic.c:1088
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687
RIP: 0010:finish_task_switch+0x267/0x8f0 kernel/sched/core.c:5256
Code: 2e 09 85 c0 0f 84 30 01 00 00 48 85 db 0f 85 4f 01 00 00 0f 1f 44 00 00 4c 89 e7 e8 53 b0 38 09 e8 7e 13 30 00 fb 4c 8b 65 b8 <49> 8d bc 24 f8 15 00 00 48 89 f8 48 c1 e8 03 42 0f b6 04 30 84 c0
RSP: 0018:ffffc9000b55f800 EFLAGS: 00000286
RAX: c5aeee5ac5091300 RBX: 0000000000000000 RCX: c5aeee5ac5091300
RDX: dffffc0000000000 RSI: ffffffff8acacbe0 RDI: ffffffff8b1d0660
RBP: ffffc9000b55f850 R08: ffffffff8e8c7caf R09: 1ffffffff1d18f95
R10: dffffc0000000000 R11: fffffbfff1d18f96 R12: ffff88801b7d0000
R13: 1ffff110171e79a9 R14: dffffc0000000000 R15: ffff8880b8f3cd48
context_switch kernel/sched/core.c:5385 [inline]
__schedule+0x15b6/0x4660 kernel/sched/core.c:6701
preempt_schedule_common+0x82/0xc0 kernel/sched/core.c:6868
preempt_schedule+0xc0/0xd0 kernel/sched/core.c:6892
preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:45
class_preempt_destructor include/linux/preempt.h:478 [inline]
try_to_wake_up+0x6f5/0x10e0 kernel/sched/core.c:4356
wake_up_process kernel/sched/core.c:4481 [inline]
wake_up_q+0xb6/0x100 kernel/sched/core.c:1032
futex_wake+0x42a/0x4f0 kernel/futex/waitwake.c:184
do_futex+0x35d/0x3e0 kernel/futex/syscalls.c:139
__do_sys_futex kernel/futex/syscalls.c:211 [inline]
__se_sys_futex+0x3a9/0x440 kernel/futex/syscalls.c:192
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f5ab539e019
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:00007f5ab626e0e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 00007f5ab5625fa8 RCX: 00007f5ab539e019
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f5ab5625fac
RBP: 00007f5ab5625fa0 R08: 0000000000745d1e R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5ab5626038 R14: 00007ffcf9492bb0 R15: 00007ffcf9492c98
Allocated by task 10598:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384
kasan_kmalloc include/linux/kasan.h:198 [inline]
__do_kmalloc_node mm/slab_common.c:1007 [inline]
__kmalloc_node+0xb6/0x240 mm/slab_common.c:1014
kmalloc_node include/linux/slab.h:620 [inline]
__bpf_map_area_alloc kernel/bpf/syscall.c:303 [inline]
bpf_map_area_alloc+0x5e/0x110 kernel/bpf/syscall.c:316
prealloc_elems_and_freelist+0x86/0x1c0 kernel/bpf/stackmap.c:51
stack_map_alloc+0x32b/0x4b0 kernel/bpf/stackmap.c:114
map_create+0x877/0x12f0 kernel/bpf/syscall.c:1247
__sys_bpf+0x651/0x890 kernel/bpf/syscall.c:5460
__do_sys_bpf kernel/bpf/syscall.c:5582 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5580 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5580
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
Last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:46
__kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492
__call_rcu_common kernel/rcu/tree.c:2721 [inline]
call_rcu+0x153/0x900 kernel/rcu/tree.c:2837
nf_unregister_net_hook net/netfilter/core.c:-1 [inline]
nf_unregister_net_hooks+0xcb/0x130 net/netfilter/core.c:613
ops_exit_list net/core/net_namespace.c:173 [inline]
cleanup_net+0x707/0xbb0 net/core/net_namespace.c:652
process_one_work kernel/workqueue.c:2653 [inline]
process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2730
worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2811
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
Second to last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:46
__kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492
__call_rcu_common kernel/rcu/tree.c:2721 [inline]
call_rcu+0x153/0x900 kernel/rcu/tree.c:2837
nf_hook_entries_free net/netfilter/core.c:88 [inline]
__nf_register_net_hook+0x787/0x910 net/netfilter/core.c:457
nf_register_net_hook+0xb2/0x190 net/netfilter/core.c:578
nf_register_net_hooks+0x44/0x1b0 net/netfilter/core.c:594
nf_ct_netns_do_get+0x3c0/0x5c0 net/netfilter/nf_conntrack_proto.c:457
nf_ct_netns_inet_get+0x1f/0x150 net/netfilter/nf_conntrack_proto.c:566
nf_conncount_init+0x127/0x380 net/netfilter/nf_conncount.c:639
ovs_ct_limit_init net/openvswitch/conntrack.c:1580 [inline]
ovs_ct_init+0x316/0x490 net/openvswitch/conntrack.c:1989
ovs_init_net+0x1e6/0x250 net/openvswitch/datapath.c:2676
ops_init+0x391/0x640 net/core/net_namespace.c:139
setup_net+0x3b6/0xa20 net/core/net_namespace.c:343
copy_net_ns+0x35e/0x5d0 net/core/net_namespace.c:520
create_new_namespaces+0x3ce/0x700 kernel/nsproxy.c:110
copy_namespaces+0x42a/0x4a0 kernel/nsproxy.c:179
copy_process+0x16f6/0x3da0 kernel/fork.c:2513
kernel_clone+0x24b/0x8a0 kernel/fork.c:2919
__do_sys_clone kernel/fork.c:3062 [inline]
__se_sys_clone kernel/fork.c:3046 [inline]
__x64_sys_clone+0x1b7/0x230 kernel/fork.c:3046
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
The buggy address belongs to the object at ffff888067906b00
which belongs to the cache kmalloc-cg-64 of size 64
The buggy address is located 16 bytes inside of
allocated 40-byte region [ffff888067906b00, ffff888067906b28)
The buggy address belongs to the physical page:
page:ffffea00019e4180 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x67906
memcg:ffff88807dde7a01
anon flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff888017c4da00 0000000000000000 0000000000000001
raw: 0000000000000000 0000000080200020 00000001ffffffff ffff88807dde7a01
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 2107, tgid 2106 (syz.5.7492), ts 1822587575123, free_ts 1822575661333
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582
prep_new_page mm/page_alloc.c:1589 [inline]
get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221
__alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501
alloc_slab_page+0x5d/0x180 mm/slub.c:1881
allocate_slab mm/slub.c:2028 [inline]
new_slab+0x87/0x2d0 mm/slub.c:2081
___slab_alloc+0xc5c/0x12f0 mm/slub.c:3253
__slab_alloc mm/slub.c:3339 [inline]
__slab_alloc_node mm/slub.c:3392 [inline]
slab_alloc_node mm/slub.c:3485 [inline]
__kmem_cache_alloc_node+0x11f/0x250 mm/slub.c:3534
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc_node+0xa6/0x240 mm/slab_common.c:1014
kmalloc_node include/linux/slab.h:620 [inline]
kvmalloc_node+0x70/0x180 mm/util.c:617
kvmalloc include/linux/slab.h:738 [inline]
kvzalloc include/linux/slab.h:746 [inline]
allocate_hook_entries_size net/netfilter/core.c:61 [inline]
__nf_hook_entries_try_shrink+0x336/0x700 net/netfilter/core.c:260
__nf_unregister_net_hook+0x4da/0x6d0 net/netfilter/core.c:520
nf_unregister_net_hook net/netfilter/core.c:-1 [inline]
nf_unregister_net_hooks+0xcb/0x130 net/netfilter/core.c:613
nf_ct_netns_do_put net/netfilter/nf_conntrack_proto.c:535 [inline]
nf_ct_netns_put+0x2d2/0x520 net/netfilter/nf_conntrack_proto.c:616
nf_conncount_destroy+0x41/0x150 net/netfilter/nf_conncount.c:687
ovs_ct_limit_exit net/openvswitch/conntrack.c:1597 [inline]
ovs_ct_exit+0x9c/0x200 net/openvswitch/conntrack.c:2000
ovs_exit_net+0xed/0x7a0 net/openvswitch/datapath.c:2718
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1182 [inline]
free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366
free_unref_page+0x32/0x2e0 mm/page_alloc.c:2459
vfree+0x1a7/0x340 mm/vmalloc.c:2868
bpf_check+0x6449/0xec30 kernel/bpf/verifier.c:20733
bpf_prog_load+0x10fa/0x1610 kernel/bpf/syscall.c:2753
__sys_bpf+0x5ba/0x890 kernel/bpf/syscall.c:5478
__do_sys_bpf kernel/bpf/syscall.c:5582 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5580 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5580
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
Memory state around the buggy address:
ffff888067906a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff888067906a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff888067906b00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
^
ffff888067906b80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff888067906c00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 2e 09 85 c0 0f 84 30 cs or %eax,0x30840fc0(%rbp)
7: 01 00 add %eax,(%rax)
9: 00 48 85 add %cl,-0x7b(%rax)
c: db 0f fisttpl (%rdi)
e: 85 4f 01 test %ecx,0x1(%rdi)
11: 00 00 add %al,(%rax)
13: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
18: 4c 89 e7 mov %r12,%rdi
1b: e8 53 b0 38 09 call 0x938b073
20: e8 7e 13 30 00 call 0x3013a3
25: fb sti
26: 4c 8b 65 b8 mov -0x48(%rbp),%r12
* 2a: 49 8d bc 24 f8 15 00 lea 0x15f8(%r12),%rdi <-- trapping instruction
31: 00
32: 48 89 f8 mov %rdi,%rax
35: 48 c1 e8 03 shr $0x3,%rax
39: 42 0f b6 04 30 movzbl (%rax,%r14,1),%eax
3e: 84 c0 test %al,%al