* [syzbot] [bpf?] KCSAN: data-race in bcmp / htab_lru_map_update_elem
@ 2026-11-25 0:53 syzbot
0 siblings, 0 replies; only message in thread
From: syzbot @ 2026-11-25 0:53 UTC (permalink / raw)
To: andrii, ast, bpf, daniel, eddyz87, emil, ihor.solodrai, jolsa,
linux-kernel, martin.lau, memxor, song, syzkaller-bugs,
yonghong.song
Hello,
syzbot found the following issue on:
HEAD commit: b6a9fa34ce41 Linux 7.4-rc4
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17783865580000
kernel config: https://syzkaller.appspot.com/x/.config?x=886d2ddd2d6b664e
dashboard link: https://syzkaller.appspot.com/bug?extid=542d2bc50fc9545a27d6
compiler: Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1cd533522ae8/disk-b6a9fa34.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/19d6c1c369e3/vmlinux-b6a9fa34.xz
kernel image: https://storage.googleapis.com/syzbot-assets/dfb541770724/bzImage-b6a9fa34.xz
AI-generated root cause summary:
Lockless RCU lookups in `BPF_MAP_TYPE_LRU_HASH` maps (`__lookup_elem_raw()`)
traverse `hlist_nulls` buckets and compare `l->key` via `memcmp()` without
waiting for an RCU grace period when elements are recycled. Concurrently,
`htab_lru_map_update_elem()` -> `prealloc_lru_pop()` evicts/pops an element `l`
via `bpf_lru_pop_free()` (which unlinks it with `hlist_nulls_del_rcu()` and
immediately writes the new `hash`) and overwrites `l->elem.key` with `memcpy()`.
An RCU reader that already loaded `l` and observes `htab_elem_hash(l) == hash`
concurrently executes `memcmp(&l->key, key, key_size)` against the in-progress
`memcpy()`, triggering a KCSAN data race and allowing torn key comparisons.
full analysis: https://syzkaller.appspot.com/x/ai_root_cause?x=542d2bc50fc9545a27d6
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+542d2bc50fc9545a27d6@syzkaller.appspotmail.com
==================================================================
BUG: KCSAN: data-race in bcmp / htab_lru_map_update_elem
write to 0xffff88811ee5cda0 of 280 bytes by task 12413 on cpu 0:
prealloc_lru_pop kernel/bpf/hashtab.c:407 [inline]
htab_lru_map_update_elem+0x223/0x7d0 kernel/bpf/hashtab.c:1516
bpf_map_update_value+0x4f7/0x570 kernel/bpf/syscall.c:297
generic_map_update_batch+0x4e6/0x700 kernel/bpf/syscall.c:2125
bpf_map_do_batch+0x26a/0x3b0 kernel/bpf/syscall.c:5849
__sys_bpf+0x784/0xc50 kernel/bpf/syscall.c:-1
__do_sys_bpf kernel/bpf/syscall.c:6582 [inline]
__se_sys_bpf kernel/bpf/syscall.c:6579 [inline]
__x64_sys_bpf+0x69/0x80 kernel/bpf/syscall.c:6579
x64_sys_call+0xf26/0x2550 arch/x86/include/generated/asm/syscalls_64.h:322
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x11e/0x3a0 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
read to 0xffff88811ee5ce88 of 8 bytes by task 12419 on cpu 1:
memcmp lib/string.c:665 [inline]
bcmp+0x23/0x90 lib/string.c:697
memcmp include/linux/fortify-string.h:675 [inline]
__lookup_elem_raw kernel/bpf/hashtab.c:827 [inline]
lookup_nulls_elem_raw kernel/bpf/hashtab.c:865 [inline]
__htab_lookup kernel/bpf/hashtab.c:889 [inline]
__htab_map_lookup_elem+0x246/0x390 kernel/bpf/hashtab.c:906
__htab_lru_map_lookup_elem kernel/bpf/hashtab.c:973 [inline]
htab_lru_map_lookup_elem_sys+0x1d/0x60 kernel/bpf/hashtab.c:991
bpf_map_copy_value+0x442/0x500 kernel/bpf/syscall.c:-1
map_lookup_elem+0x511/0x700 kernel/bpf/syscall.c:1847
__sys_bpf+0x683/0xc50 kernel/bpf/syscall.c:6440
__do_sys_bpf kernel/bpf/syscall.c:6582 [inline]
__se_sys_bpf kernel/bpf/syscall.c:6579 [inline]
__x64_sys_bpf+0x69/0x80 kernel/bpf/syscall.c:6579
x64_sys_call+0xf26/0x2550 arch/x86/include/generated/asm/syscalls_64.h:322
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x11e/0x3a0 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 12419 Comm: syz.0.3950 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
==================================================================
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-25 0:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 0:53 [syzbot] [bpf?] KCSAN: data-race in bcmp / htab_lru_map_update_elem syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox