syzbot


KCSAN: data-race in alloc_htab_elem / bcmp

Status: moderation: reported on 2025/12/15 11:23
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+568abfa605e4f389ea53@syzkaller.appspotmail.com
First crash: 16h13m, last: 16h13m

Sample crash report:
==================================================================
BUG: KCSAN: data-race in alloc_htab_elem / bcmp

write to 0xffff88811ae3c270 of 4 bytes by task 8146 on cpu 0:
 alloc_htab_elem+0x226/0x420 kernel/bpf/hashtab.c:1029
 htab_map_update_elem+0x312/0x980 kernel/bpf/hashtab.c:1149
 bpf_map_update_value+0x4f4/0x570 kernel/bpf/syscall.c:294
 generic_map_update_batch+0x3eb/0x540 kernel/bpf/syscall.c:2038
 bpf_map_do_batch+0x25c/0x380 kernel/bpf/syscall.c:5647
 __sys_bpf+0x5f8/0x7c0 kernel/bpf/syscall.c:-1
 __do_sys_bpf kernel/bpf/syscall.c:6274 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:6272 [inline]
 __x64_sys_bpf+0x41/0x50 kernel/bpf/syscall.c:6272
 x64_sys_call+0x28e1/0x3000 arch/x86/include/generated/asm/syscalls_64.h:322
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd8/0x2c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88811ae3c271 of 1 bytes by task 8149 on cpu 1:
 memcmp lib/string.c:694 [inline]
 bcmp+0x52/0x90 lib/string.c:715
 memcmp include/linux/fortify-string.h:727 [inline]
 lookup_nulls_elem_raw kernel/bpf/hashtab.c:639 [inline]
 __htab_map_lookup_elem+0xd0/0x150 kernel/bpf/hashtab.c:668
 bpf_prog_f32ce9a4f916f6a1+0x48/0x59
 bpf_dispatcher_nop_func include/linux/bpf.h:1376 [inline]
 __bpf_prog_run include/linux/filter.h:723 [inline]
 bpf_prog_run include/linux/filter.h:730 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2075 [inline]
 bpf_trace_run3+0x10f/0x1e0 kernel/trace/bpf_trace.c:2117
 __traceiter_kmem_cache_free+0x38/0x60 include/trace/events/kmem.h:117
 __do_trace_kmem_cache_free include/trace/events/kmem.h:117 [inline]
 trace_kmem_cache_free include/trace/events/kmem.h:117 [inline]
 kmem_cache_free+0x327/0x3a0 mm/slub.c:6778
 putname+0x90/0x100 fs/namei.c:297
 __free_putname include/linux/fs.h:2512 [inline]
 do_sys_openat2+0xd7/0x150 fs/open.c:1431
 do_sys_open fs/open.c:1436 [inline]
 __do_sys_openat fs/open.c:1452 [inline]
 __se_sys_openat fs/open.c:1447 [inline]
 __x64_sys_openat+0xf2/0x120 fs/open.c:1447
 x64_sys_call+0x2b07/0x3000 arch/x86/include/generated/asm/syscalls_64.h:258
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd8/0x2c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00 -> 0x2f

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 8149 Comm: syz.1.1240 Tainted: G        W           syzkaller #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/12/15 11:23 upstream 8f0b4cce4481 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in alloc_htab_elem / bcmp
* Struck through repros no longer work on HEAD.