syzbot


KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset

Status: upstream: reported C repro on 2025/11/05 21:42
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+0a0a24a8d9eb27203929@syzkaller.appspotmail.com
Fix commit: 4443fc58fcc2 softirq: Add trace points for tasklet entry/exit
Patched on: [], missing on: [ci2-linux-6-1-kasan ci2-linux-6-1-kasan-arm64 ci2-linux-6-1-kasan-perf]
First crash: 47d, last: 37d
Fix bisection: fixed by (bisect log) :
commit 4443fc58fcc283a9a7aa73f2f30e427296612ec7
Author: Sumanth Gavini <sumanth.gavini@yahoo.com>
Date: Wed Nov 12 03:16:20 2025 +0000

  softirq: Add trace points for tasklet entry/exit

  
Bug presence (2)
Date Name Commit Repro Result
2025/11/15 linux-6.1.y (ToT) f6e38ae624cf C [report] KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset
2025/11/15 upstream (ToT) 7a0892d2836e C Didn't crash
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset origin:lts-only 23 C 3 1d19h 48d 0/3 upstream: reported C repro on 2025/11/04 17:48

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in stack_map_get_build_id_offset+0x842/0x9c0 kernel/bpf/stackmap.c:147
Write of size 4 at addr ffff88805ab2d240 by task syz.1.2257/6763

CPU: 1 PID: 6763 Comm: syz.1.2257 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e 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
 stack_map_get_build_id_offset+0x842/0x9c0 kernel/bpf/stackmap.c:147
 __bpf_get_stackid+0x55d/0x920 kernel/bpf/stackmap.c:250
 ____bpf_get_stackid_raw_tp kernel/trace/bpf_trace.c:1855 [inline]
 bpf_get_stackid_raw_tp+0x175/0x1b0 kernel/trace/bpf_trace.c:1844
 bpf_prog_b724608cae728045+0x1e/0x22
 bpf_dispatcher_nop_func include/linux/bpf.h:1012 [inline]
 __bpf_prog_run include/linux/filter.h:603 [inline]
 bpf_prog_run include/linux/filter.h:610 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2285 [inline]
 bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324
 __bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:94
 __traceiter_kfree+0x26/0x40 include/trace/events/kmem.h:94
 trace_kfree include/trace/events/kmem.h:94 [inline]
 kfree+0xf6/0x190 mm/slab_common.c:975
 check_cfg+0xfb6/0x10a0 kernel/bpf/verifier.c:11204
 bpf_check+0x3e70/0x10ca0 kernel/bpf/verifier.c:15572
 bpf_prog_load+0x1072/0x15a0 kernel/bpf/syscall.c:2648
 __sys_bpf+0x520/0x6d0 kernel/bpf/syscall.c:5027
 __do_sys_bpf kernel/bpf/syscall.c:5131 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5129 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5129
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7efe2d58f6c9
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:00007ffe2433c098 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007efe2d7e5fa0 RCX: 00007efe2d58f6c9
RDX: 0000000000000094 RSI: 0000200000000680 RDI: 0000000000000005
RBP: 00007efe2d611f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007efe2d7e5fa0 R14: 00007efe2d7e5fa0 R15: 0000000000000003
 </TASK>

Allocated by task 6761:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc_node+0xb0/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+0x390/0x520 kernel/bpf/stackmap.c:117
 find_and_alloc_map kernel/bpf/syscall.c:133 [inline]
 map_create+0x534/0x1000 kernel/bpf/syscall.c:1149
 __sys_bpf+0x2f3/0x6d0 kernel/bpf/syscall.c:5009
 __do_sys_bpf kernel/bpf/syscall.c:5131 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5129 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5129
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 insert_work+0x54/0x3c0 kernel/workqueue.c:1361
 __queue_work+0xba3/0xfb0 kernel/workqueue.c:1520
 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1548
 __bpf_free_used_maps kernel/bpf/core.c:2570 [inline]
 bpf_free_used_maps kernel/bpf/core.c:2576 [inline]
 bpf_prog_free_deferred+0x140/0x5e0 kernel/bpf/core.c:2615
 process_one_work+0x898/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Second to last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 insert_work+0x54/0x3c0 kernel/workqueue.c:1361
 __queue_work+0xba3/0xfb0 kernel/workqueue.c:1520
 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1548
 __bpf_free_used_maps kernel/bpf/core.c:2570 [inline]
 bpf_free_used_maps kernel/bpf/core.c:2576 [inline]
 bpf_prog_free_deferred+0x140/0x5e0 kernel/bpf/core.c:2615
 process_one_work+0x898/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff88805ab2d000
 which belongs to the cache kmalloc-cg-1k of size 1024
The buggy address is located 576 bytes inside of
 1024-byte region [ffff88805ab2d000, ffff88805ab2d400)

The buggy address belongs to the physical page:
page:ffffea00016aca00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805ab2a000 pfn:0x5ab28
head:ffffea00016aca00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88802ef72301
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001f13200 dead000000000002 ffff88801744c000
raw: ffff88805ab2a000 000000008010000b 00000001ffffffff ffff88802ef72301
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4297, tgid 4297 (syz-executor), ts 80602577431, free_ts 12064790538
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
 prep_new_page mm/page_alloc.c:2539 [inline]
 get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
 alloc_slab_page+0x5d/0x160 mm/slub.c:1799
 allocate_slab mm/slub.c:1944 [inline]
 new_slab+0x87/0x2c0 mm/slub.c:1997
 ___slab_alloc+0xbc6/0x1230 mm/slub.c:3154
 __slab_alloc mm/slub.c:3240 [inline]
 slab_alloc_node mm/slub.c:3325 [inline]
 __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3398
 __do_kmalloc_node mm/slab_common.c:935 [inline]
 __kmalloc+0xa0/0x240 mm/slab_common.c:949
 kmalloc include/linux/slab.h:568 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 __register_sysctl_table+0xef/0xe70 fs/proc/proc_sysctl.c:1345
 neigh_sysctl_register+0x993/0xa70 net/core/neighbour.c:3858
 devinet_sysctl_register+0xa8/0x1f0 net/ipv4/devinet.c:2649
 inetdev_init+0x2b4/0x4f0 net/ipv4/devinet.c:280
 inetdev_event+0x270/0x1410 net/ipv4/devinet.c:1547
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455
 call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
 call_netdevice_notifiers net/core/dev.c:2053 [inline]
 register_netdevice+0x1600/0x1aa0 net/core/dev.c:10237
 register_netdev+0x37/0x50 net/core/dev.c:10332
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1459 [inline]
 free_pcp_prepare mm/page_alloc.c:1509 [inline]
 free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
 free_contig_range+0x9d/0x150 mm/page_alloc.c:9574
 destroy_args+0x100/0xa31 mm/debug_vm_pgtable.c:1031
 debug_vm_pgtable+0x32a/0x37e mm/debug_vm_pgtable.c:1359
 do_one_initcall+0x214/0x7a0 init/main.c:1310
 do_initcall_level+0x137/0x1e4 init/main.c:1383
 do_initcalls+0x4b/0x8a init/main.c:1399
 kernel_init_freeable+0x3fa/0x5ac init/main.c:1638
 kernel_init+0x19/0x1b0 init/main.c:1526
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Memory state around the buggy address:
 ffff88805ab2d100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88805ab2d180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88805ab2d200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
                                           ^
 ffff88805ab2d280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88805ab2d300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/15 15:53 linux-6.1.y f6e38ae624cf f7988ea4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset
2025/11/15 14:02 linux-6.1.y f6e38ae624cf f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset
2025/11/05 21:42 linux-6.1.y f6e38ae624cf a6c9c731 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset
* Struck through repros no longer work on HEAD.