syzbot


KCSAN: data-race in bpf_lru_pop_free / htab_lru_percpu_map_lookup_percpu_elem (2)

Status: moderation: reported on 2024/11/10 16:57
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+9faa5bd2a137139412e8@syzkaller.appspotmail.com
First crash: 7d08h, last: 7d08h
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in bpf_lru_pop_free / htab_lru_percpu_map_lookup_percpu_elem bpf 1 220d 220d 0/28 auto-obsoleted due to no activity on 2024/05/16 12:41

Sample crash report:
==================================================================
BUG: KCSAN: data-race in bpf_lru_pop_free / htab_lru_percpu_map_lookup_percpu_elem

write to 0xffff8881150d79a8 of 4 bytes by task 22506 on cpu 1:
 __local_list_add_pending kernel/bpf/bpf_lru_list.c:358 [inline]
 bpf_common_lru_pop_free kernel/bpf/bpf_lru_list.c:457 [inline]
 bpf_lru_pop_free+0xc61/0xd30 kernel/bpf/bpf_lru_list.c:504
 prealloc_lru_pop kernel/bpf/hashtab.c:308 [inline]
 __htab_lru_percpu_map_update_elem+0xfe/0x630 kernel/bpf/hashtab.c:1359
 bpf_percpu_hash_update+0x5e/0xa0 kernel/bpf/hashtab.c:2425
 bpf_map_update_value+0x2b1/0x350 kernel/bpf/syscall.c:181
 generic_map_update_batch+0x401/0x520 kernel/bpf/syscall.c:1849
 bpf_map_do_batch+0x28c/0x3f0 kernel/bpf/syscall.c:5162
 __sys_bpf+0x2e5/0x7a0
 __do_sys_bpf kernel/bpf/syscall.c:5760 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5758 [inline]
 __x64_sys_bpf+0x43/0x50 kernel/bpf/syscall.c:5758
 x64_sys_call+0x2625/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:322
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881150d79a8 of 4 bytes by task 22523 on cpu 0:
 lookup_nulls_elem_raw kernel/bpf/hashtab.c:667 [inline]
 __htab_map_lookup_elem kernel/bpf/hashtab.c:697 [inline]
 htab_lru_percpu_map_lookup_percpu_elem+0xe3/0x200 kernel/bpf/hashtab.c:2376
 bpf_prog_30f6e55231ed8cc8+0x40/0x44
 bpf_dispatcher_nop_func include/linux/bpf.h:1265 [inline]
 __bpf_prog_run include/linux/filter.h:701 [inline]
 bpf_prog_run include/linux/filter.h:708 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2316 [inline]
 bpf_trace_run3+0x10c/0x1d0 kernel/trace/bpf_trace.c:2358
 trace_kmem_cache_free include/trace/events/kmem.h:114 [inline]
 kmem_cache_free+0x237/0x2d0 mm/slub.c:4680
 __kfree_skb+0x102/0x150 net/core/skbuff.c:1205
 consume_skb+0x49/0x160 net/core/skbuff.c:1436
 nlmon_xmit+0x51/0x60 drivers/net/nlmon.c:15
 __netdev_start_xmit include/linux/netdevice.h:4928 [inline]
 netdev_start_xmit include/linux/netdevice.h:4937 [inline]
 xmit_one net/core/dev.c:3588 [inline]
 dev_hard_start_xmit+0x119/0x3f0 net/core/dev.c:3604
 __dev_queue_xmit+0xfba/0x2040 net/core/dev.c:4432
 dev_queue_xmit include/linux/netdevice.h:3094 [inline]
 __netlink_deliver_tap_skb net/netlink/af_netlink.c:307 [inline]
 __netlink_deliver_tap+0x39f/0x4c0 net/netlink/af_netlink.c:325
 netlink_deliver_tap net/netlink/af_netlink.c:338 [inline]
 netlink_deliver_tap_kernel net/netlink/af_netlink.c:347 [inline]
 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
 netlink_unicast+0x64a/0x670 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x5cc/0x6e0 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:729 [inline]
 __sock_sendmsg+0x140/0x180 net/socket.c:744
 __sys_sendto+0x1d6/0x260 net/socket.c:2214
 __do_sys_sendto net/socket.c:2226 [inline]
 __se_sys_sendto net/socket.c:2222 [inline]
 __x64_sys_sendto+0x78/0x90 net/socket.c:2222
 x64_sys_call+0x2959/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:45
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0xc806af34 -> 0x1e18f68e

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 22523 Comm: syz.8.6581 Not tainted 6.12.0-rc6-syzkaller-00279-gde2f378f2b77 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/10 16:56 upstream de2f378f2b77 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in bpf_lru_pop_free / htab_lru_percpu_map_lookup_percpu_elem
* Struck through repros no longer work on HEAD.