==================================================================
BUG: KASAN: slab-out-of-bounds in stack_map_get_build_id_offset+0x6c0/0x720 kernel/bpf/stackmap.c:144
Write of size 4 at addr ffff88805c1ad910 by task syz.6.3485/17645
CPU: 0 PID: 17645 Comm: syz.6.3485 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/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
stack_map_get_build_id_offset+0x6c0/0x720 kernel/bpf/stackmap.c:144
__bpf_get_stackid+0x564/0x900 kernel/bpf/stackmap.c:247
____bpf_get_stackid_pe kernel/bpf/stackmap.c:362 [inline]
bpf_get_stackid_pe+0x343/0x410 kernel/bpf/stackmap.c:331
bpf_prog_a82986b851e905af+0x30/0x42
bpf_dispatcher_nop_func include/linux/bpf.h:1226 [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:10584
__perf_event_overflow+0x461/0x660 kernel/events/core.c:9720
perf_event_overflow kernel/events/core.c:9741 [inline]
perf_swevent_hrtimer+0x437/0x610 kernel/events/core.c:11230
__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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0xc0/0x120 kernel/locking/spinlock.c:194
Code: c7 44 24 20 00 00 00 00 9c 8f 44 24 20 f7 44 24 20 00 02 00 00 41 c6 04 07 f8 75 4b f7 c3 00 02 00 00 74 01 fb bf 01 00 00 00 ab 96 c0 f6 65 8b 05 1c 54 67 75 85 c0 74 3c 48 c7 04 24 0e 36
RSP: 0018:ffffc9000f97fae0 EFLAGS: 00000206
RAX: dffffc0000000004 RBX: 0000000000000a06 RCX: c5501766a1c0bf00
RDX: dffffc0000000000 RSI: ffffffff8acacce0 RDI: 0000000000000001
RBP: ffffc9000f97fb70 R08: ffffffff8e8c626f R09: 1ffffffff1d18c4d
R10: dffffc0000000000 R11: fffffbfff1d18c4e R12: dffffc0000000000
R13: ffff8880b8e3cf98 R14: ffff88807ced2808 R15: 1ffff92001f2ff5c
class_raw_spinlock_irqsave_destructor include/linux/spinlock.h:524 [inline]
try_to_wake_up+0x680/0x10e0 kernel/sched/core.c:4233
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:0x7f5565f9e199
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:00007f5566f240e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 00007f5566225fa8 RCX: 00007f5565f9e199
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f5566225fac
RBP: 00007f5566225fa0 R08: 0000000000745d1e R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5566226038 R14: 00007ffc1c694310 R15: 00007ffc1c6943f8
Allocated by task 17645:
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:5476
__do_sys_bpf kernel/bpf/syscall.c:5598 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5596 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5596
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 ffff88805c1ad800
which belongs to the cache kmalloc-cg-512 of size 512
The buggy address is located 0 bytes to the right of
allocated 272-byte region [ffff88805c1ad800, ffff88805c1ad910)
The buggy address belongs to the physical page:
page:ffffea0001706b00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5c1ac
head:ffffea0001706b00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88802f292501
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888017c4f140 dead000000000100 dead000000000122
raw: 0000000000000000 0000000080100010 00000001ffffffff ffff88802f292501
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5132, tgid 5132 (klogd), ts 86945649530, free_ts 86857285950
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_track_caller+0xa4/0x230 mm/slab_common.c:1027
kmalloc_reserve+0x116/0x240 net/core/skbuff.c:584
__alloc_skb+0x138/0x2c0 net/core/skbuff.c:653
alloc_skb include/linux/skbuff.h:1316 [inline]
alloc_skb_with_frags+0xcd/0x7a0 net/core/skbuff.c:6365
sock_alloc_send_pskb+0x883/0x9a0 net/core/sock.c:2829
unix_dgram_sendmsg+0x5a9/0x16e0 net/unix/af_unix.c:2013
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
__sys_sendto+0x4a9/0x6b0 net/socket.c:2201
__do_sys_sendto net/socket.c:2213 [inline]
__se_sys_sendto net/socket.c:2209 [inline]
__x64_sys_sendto+0xde/0xf0 net/socket.c:2209
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
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
__stack_depot_save+0x587/0x660 lib/stackdepot.c:443
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_set_track+0x5f/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1811 [inline]
slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837
slab_free mm/slub.c:3830 [inline]
__kmem_cache_free+0xba/0x1f0 mm/slub.c:3843
bpf_int_jit_compile+0xfc0/0x1240 arch/x86/net/bpf_jit_comp.c:2981
bpf_prog_select_runtime+0x490/0x7d0 kernel/bpf/core.c:2474
bpf_prog_load+0x1125/0x1610 kernel/bpf/syscall.c:2757
__sys_bpf+0x5ba/0x890 kernel/bpf/syscall.c:5494
__do_sys_bpf kernel/bpf/syscall.c:5598 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5596 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5596
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:
ffff88805c1ad800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88805c1ad880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88805c1ad900: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88805c1ad980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88805c1ada00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: c7 44 24 20 00 00 00 movl $0x0,0x20(%rsp)
7: 00
8: 9c pushf
9: 8f 44 24 20 pop 0x20(%rsp)
d: f7 44 24 20 00 02 00 testl $0x200,0x20(%rsp)
14: 00
15: 41 c6 04 07 f8 movb $0xf8,(%r15,%rax,1)
1a: 75 4b jne 0x67
1c: f7 c3 00 02 00 00 test $0x200,%ebx
22: 74 01 je 0x25
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 ab 96 c0 f6 call 0xf6c096da <-- trapping instruction
2f: 65 8b 05 1c 54 67 75 mov %gs:0x7567541c(%rip),%eax # 0x75675452
36: 85 c0 test %eax,%eax
38: 74 3c je 0x76
3a: 48 rex.W
3b: c7 .byte 0xc7
3c: 04 24 add $0x24,%al
3e: 0e (bad)
3f: 36 ss