==================================================================
BUG: KASAN: slab-out-of-bounds in stack_map_get_build_id_offset+0x5d2/0x860 kernel/bpf/stackmap.c:189
Write of size 8 at addr ffff888078b3f248 by task syz.2.925/7672
CPU: 0 PID: 7672 Comm: syz.2.925 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
stack_map_get_build_id_offset+0x5d2/0x860 kernel/bpf/stackmap.c:189
__bpf_get_stackid+0x55d/0x920 kernel/bpf/stackmap.c:294
____bpf_get_stackid_raw_tp kernel/trace/bpf_trace.c:1465 [inline]
bpf_get_stackid_raw_tp+0x175/0x1b0 kernel/trace/bpf_trace.c:1454
bpf_prog_b724608cae728045+0x1e/0xa8c
bpf_dispatcher_nop_func include/linux/bpf.h:888 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1878 [inline]
bpf_trace_run2+0x15b/0x2d0 kernel/trace/bpf_trace.c:1915
__bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:118
trace_kfree include/trace/events/kmem.h:118 [inline]
kfree+0x25f/0x2a0 mm/slub.c:4554
skb_free_head net/core/skbuff.c:655 [inline]
skb_release_data+0x6fe/0x850 net/core/skbuff.c:677
skb_release_all net/core/skbuff.c:742 [inline]
__kfree_skb net/core/skbuff.c:756 [inline]
consume_skb+0xa2/0x100 net/core/skbuff.c:914
mac80211_hwsim_beacon_tx+0x4f3/0x920 drivers/net/wireless/mac80211_hwsim.c:1842
__iterate_interfaces+0x243/0x500 net/mac80211/util.c:793
ieee80211_iterate_active_interfaces_atomic+0xb3/0x140 net/mac80211/util.c:829
mac80211_hwsim_beacon+0x9b/0x180 drivers/net/wireless/mac80211_hwsim.c:1865
__run_hrtimer kernel/time/hrtimer.c:1685 [inline]
__hrtimer_run_queues+0x53d/0xc40 kernel/time/hrtimer.c:1749
hrtimer_run_softirq+0x176/0x240 kernel/time/hrtimer.c:1766
handle_softirqs+0x328/0x820 kernel/softirq.c:576
__do_softirq kernel/softirq.c:610 [inline]
invoke_softirq kernel/softirq.c:450 [inline]
__irq_exit_rcu+0x12f/0x220 kernel/softirq.c:659
irq_exit_rcu+0x5/0x20 kernel/softirq.c:671
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1108
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
RIP: 0010:unwind_get_return_address+0x4/0x80 arch/x86/kernel/unwind_orc.c:319
Code: 49 89 fe 48 89 f7 49 89 f7 e8 b8 bc 87 00 4c 89 f7 4c 89 fe e9 2d ff ff ff e8 58 f6 74 08 0f 1f 84 00 00 00 00 00 41 57 41 56 <53> 48 89 fb 49 be 00 00 00 00 00 fc ff df 48 89 f8 48 c1 e8 03 42
RSP: 0018:ffffc9000323eeb0 EFLAGS: 00000202
RAX: 0000000080000001 RBX: ffffc9000323ef80 RCX: 0000000080000000
RDX: ffffc9000323ef01 RSI: ffffc9000323fdb0 RDI: ffffc9000323eec8
RBP: ffffc9000323ef50 R08: dffffc0000000000 R09: ffffc9000323ef18
R10: fffff52000647de5 R11: 1ffff92000647de3 R12: ffff8880467bbb80
R13: ffff88801b3f0000 R14: ffffffff81667ac0 R15: ffffc9000323eec8
arch_stack_walk+0xf2/0x140 arch/x86/kernel/stacktrace.c:26
stack_trace_save+0x98/0xe0 kernel/stacktrace.c:122
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
bpf_prog_calc_tag+0x5b4/0x6b0 kernel/bpf/core.c:337
resolve_pseudo_ldimm64+0xd4/0x1030 kernel/bpf/verifier.c:11835
bpf_check+0x30a4/0xf090 kernel/bpf/verifier.c:14125
bpf_prog_load+0x1043/0x1550 kernel/bpf/syscall.c:2354
__sys_bpf+0x4c2/0x670 kernel/bpf/syscall.c:4657
__do_sys_bpf kernel/bpf/syscall.c:4761 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4759 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f41d8d076c9
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:00007f41d6f6e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f41d8f5dfa0 RCX: 00007f41d8d076c9
RDX: 0000000000000048 RSI: 0000200000000200 RDI: 0000000000000005
RBP: 00007f41d8d89f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f41d8f5e038 R14: 00007f41d8f5dfa0 R15: 00007fff9c359128
Allocated by task 7680:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc mm/kasan/common.c:513 [inline]
__kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522
kmalloc_node include/linux/slab.h:630 [inline]
__bpf_map_area_alloc kernel/bpf/syscall.c:322 [inline]
bpf_map_area_alloc+0x47/0xe0 kernel/bpf/syscall.c:335
prealloc_elems_and_freelist+0x86/0x1c0 kernel/bpf/stackmap.c:70
stack_map_alloc+0x3c9/0x570 kernel/bpf/stackmap.c:137
find_and_alloc_map kernel/bpf/syscall.c:129 [inline]
map_create+0x485/0x2350 kernel/bpf/syscall.c:881
__sys_bpf+0x2a4/0x670 kernel/bpf/syscall.c:4639
__do_sys_bpf kernel/bpf/syscall.c:4761 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4759 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Last potentially related work creation:
kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
insert_work+0x54/0x3d0 kernel/workqueue.c:1366
__queue_work+0x9c5/0xd50 kernel/workqueue.c:1532
queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1559
bpf_map_put_with_uref kernel/bpf/syscall.c:538 [inline]
bpf_map_release+0x115/0x130 kernel/bpf/syscall.c:548
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
exit_task_work include/linux/task_work.h:33 [inline]
do_exit+0x61e/0x20a0 kernel/exit.c:883
do_group_exit+0x12e/0x300 kernel/exit.c:997
get_signal+0x6ca/0x12c0 kernel/signal.c:2900
arch_do_signal_or_restart+0xc1/0x1300 arch/x86/kernel/signal.c:867
handle_signal_work kernel/entry/common.c:154 [inline]
exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:280
The buggy address belongs to the object at ffff888078b3f000
which belongs to the cache kmalloc-cg-1k of size 1024
The buggy address is located 584 bytes inside of
1024-byte region [ffff888078b3f000, ffff888078b3f400)
The buggy address belongs to the page:
page:ffffea0001e2ce00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78b38
head:ffffea0001e2ce00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88801ed12201
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff88801684c000
raw: 0000000000000000 0000000000100010 00000001ffffffff ffff88801ed12201
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 3563, ts 27690597334, free_ts 27649041068
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
__alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
alloc_slab_page mm/slub.c:1780 [inline]
allocate_slab mm/slub.c:1917 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1980
___slab_alloc+0x81e/0xdf0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
slab_alloc mm/slub.c:3233 [inline]
__kmalloc+0x1cd/0x330 mm/slub.c:4408
kmalloc_array include/linux/slab.h:647 [inline]
kcalloc include/linux/slab.h:676 [inline]
alloc_pipe_info+0x1f8/0x4b0 fs/pipe.c:811
get_pipe_inode fs/pipe.c:885 [inline]
create_pipe_files+0x85/0x700 fs/pipe.c:917
__do_pipe_flags+0x46/0x1f0 fs/pipe.c:966
do_pipe2+0x99/0x170 fs/pipe.c:1014
__do_sys_pipe2 fs/pipe.c:1032 [inline]
__se_sys_pipe2 fs/pipe.c:1030 [inline]
__x64_sys_pipe2+0x56/0x60 fs/pipe.c:1030
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x94/0x280 mm/page_alloc.c:3396
free_slab mm/slub.c:2020 [inline]
discard_slab mm/slub.c:2026 [inline]
__unfreeze_partials+0x1a5/0x200 mm/slub.c:2512
put_cpu_partial+0x12d/0x190 mm/slub.c:2592
qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
slab_alloc mm/slub.c:3233 [inline]
__kmalloc+0x127/0x330 mm/slub.c:4408
kmalloc include/linux/slab.h:612 [inline]
tomoyo_realpath_from_path+0x118/0x610 security/tomoyo/realpath.c:254
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x183/0x360 security/tomoyo/file.c:771
security_file_open+0x5e/0xa0 security/security.c:1668
do_dentry_open+0x322/0xf80 fs/open.c:813
do_open fs/namei.c:3616 [inline]
path_openat+0x2682/0x2f30 fs/namei.c:3750
do_filp_open+0x1b3/0x3e0 fs/namei.c:3777
do_sys_openat2+0x142/0x4a0 fs/open.c:1253
Memory state around the buggy address:
ffff888078b3f100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888078b3f180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888078b3f200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
^
ffff888078b3f280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888078b3f300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 49 89 fe mov %rdi,%r14
3: 48 89 f7 mov %rsi,%rdi
6: 49 89 f7 mov %rsi,%r15
9: e8 b8 bc 87 00 call 0x87bcc6
e: 4c 89 f7 mov %r14,%rdi
11: 4c 89 fe mov %r15,%rsi
14: e9 2d ff ff ff jmp 0xffffff46
19: e8 58 f6 74 08 call 0x874f676
1e: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
25: 00
26: 41 57 push %r15
28: 41 56 push %r14
* 2a: 53 push %rbx <-- trapping instruction
2b: 48 89 fb mov %rdi,%rbx
2e: 49 be 00 00 00 00 00 movabs $0xdffffc0000000000,%r14
35: fc ff df
38: 48 89 f8 mov %rdi,%rax
3b: 48 c1 e8 03 shr $0x3,%rax
3f: 42 rex.X