syzbot


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

Status: upstream: reported C repro on 2025/11/04 17:48
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+719dd22a369472027864@syzkaller.appspotmail.com
First crash: 71d, last: 25d
Bug presence (2)
Date Name Commit Repro Result
2025/11/17 linux-5.15.y (ToT) cc5ec8769306 C [report] KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset
2025/11/17 upstream (ToT) 6a23ae0a96a6 C Didn't crash
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset origin:lts-only 23 C done 3 60d 70d 3/3 fixed on 2026/01/11 15:32
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2025/12/21 07:37 2h06m bisect fix linux-5.15.y OK (0) job log log

Sample crash report:
==================================================================
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 ffff888079713248 by task syz.1.136/4524

CPU: 0 PID: 4524 Comm: syz.1.136 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/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/0x3e4
 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
 __traceiter_kfree+0x26/0x40 include/trace/events/kmem.h:118
 trace_kfree include/trace/events/kmem.h:118 [inline]
 kfree+0x25f/0x2a0 mm/slub.c:4554
 _free_event+0x822/0xe60 kernel/events/core.c:5161
 put_event kernel/events/core.c:5258 [inline]
 perf_event_release_kernel+0x832/0x8c0 kernel/events/core.c:5383
 perf_release+0x37/0x40 kernel/events/core.c:5393
 __fput+0x234/0x930 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
 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
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f8276aa06c9
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:00007ffe9534b378 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 0000000000013f9a RCX: 00007f8276aa06c9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000001 R09: 000000049534b66f
R10: 0000001b30c20000 R11: 0000000000000246 R12: 00007f8276cf6fac
R13: 00007f8276cf6fa0 R14: ffffffffffffffff R15: 0000000000000003
 </TASK>

Allocated by task 4524:
 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

The buggy address belongs to the object at ffff888079713000
 which belongs to the cache kmalloc-cg-1k of size 1024
The buggy address is located 584 bytes inside of
 1024-byte region [ffff888079713000, ffff888079713400)
The buggy address belongs to the page:
page:ffffea0001e5c400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79710
head:ffffea0001e5c400 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88807df19f01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0000758400 0000000700000007 ffff88801684c000
raw: 0000000000000000 0000000080100010 00000001ffffffff ffff88807df19f01
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 4206, ts 63596016947, free_ts 63582633780
 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]
 __kmalloc_node+0x200/0x3b0 mm/slub.c:4456
 kmalloc_node include/linux/slab.h:630 [inline]
 kvmalloc_node+0x84/0x130 mm/util.c:619
 kvmalloc include/linux/mm.h:816 [inline]
 xt_alloc_table_info+0x37/0xa0 net/netfilter/x_tables.c:1192
 ip6t_register_table+0xb9/0x7e0 net/ipv6/netfilter/ip6_tables.c:1746
 ip6table_raw_table_init+0x50/0x70 net/ipv6/netfilter/ip6table_raw.c:56
 xt_find_table_lock+0x220/0x360 net/netfilter/x_tables.c:1259
 xt_request_find_table_lock+0x22/0x100 net/netfilter/x_tables.c:1284
 get_info net/ipv6/netfilter/ip6_tables.c:981 [inline]
 do_ip6t_get_ctl+0x5f8/0x1090 net/ipv6/netfilter/ip6_tables.c:1670
 nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116
 ipv6_getsockopt+0x442/0x2000 net/ipv6/ipv6_sockglue.c:1492
 tcp_getsockopt+0x1e3/0x2390 net/ipv4/tcp.c:4319
 __sys_getsockopt+0x1b0/0x230 net/socket.c:2257
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]
 __kmalloc_node+0x15a/0x3b0 mm/slub.c:4456
 kmalloc_node include/linux/slab.h:630 [inline]
 kvmalloc_node+0x84/0x130 mm/util.c:619
 kvmalloc include/linux/mm.h:816 [inline]
 kvzalloc include/linux/mm.h:824 [inline]
 proc_sys_call_handler+0x360/0x6c0 fs/proc/proc_sysctl.c:571
 call_write_iter include/linux/fs.h:2173 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x712/0xd00 fs/read_write.c:594
 ksys_write+0x14d/0x250 fs/read_write.c:647
 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

Memory state around the buggy address:
 ffff888079713100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888079713180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888079713200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
                                              ^
 ffff888079713280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888079713300: 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/16 08:47 linux-5.15.y cc5ec8769306 f7988ea4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset
2025/11/16 05:59 linux-5.15.y cc5ec8769306 f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset
2025/11/04 17:47 linux-5.15.y cc5ec8769306 686bf657 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf KASAN: slab-out-of-bounds Write in stack_map_get_build_id_offset
* Struck through repros no longer work on HEAD.