syzbot


KCSAN: data-race in ip_vs_add_service / ip_vs_out_hook

Status: moderation: reported on 2025/06/04 09:50
Subsystems: lvs
[Documentation on labels]
Reported-by: syzbot+1651b5234028c294c339@syzkaller.appspotmail.com
First crash: 53d, last: 9d18h

Sample crash report:
==================================================================
BUG: KCSAN: data-race in ip_vs_add_service / ip_vs_out_hook

write to 0xffff888117423804 of 4 bytes by task 13695 on cpu 1:
 ip_vs_add_service+0xa18/0xa70 net/netfilter/ipvs/ip_vs_ctl.c:1487
 do_ip_vs_set_ctl+0x6ec/0x8c0 net/netfilter/ipvs/ip_vs_ctl.c:2807
 nf_setsockopt+0x199/0x1b0 net/netfilter/nf_sockopt.c:101
 ip_setsockopt+0x102/0x110 net/ipv4/ip_sockglue.c:1424
 udp_setsockopt+0x99/0xb0 net/ipv4/udp.c:3084
 sock_common_setsockopt+0x69/0x80 net/core/sock.c:3944
 do_sock_setsockopt net/socket.c:2296 [inline]
 __sys_setsockopt+0x181/0x200 net/socket.c:2321
 __do_sys_setsockopt net/socket.c:2327 [inline]
 __se_sys_setsockopt net/socket.c:2324 [inline]
 __x64_sys_setsockopt+0x64/0x80 net/socket.c:2324
 x64_sys_call+0x2bd5/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:55
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888117423804 of 4 bytes by task 13687 on cpu 0:
 ip_vs_out_hook+0x1c1/0x920 net/netfilter/ipvs/ip_vs_core.c:1356
 nf_hook_entry_hookfn include/linux/netfilter.h:157 [inline]
 nf_hook_slow+0x75/0x180 net/netfilter/core.c:623
 nf_hook include/linux/netfilter.h:272 [inline]
 __ip_local_out+0x2cb/0x2f0 net/ipv4/ip_output.c:118
 ip_local_out net/ipv4/ip_output.c:127 [inline]
 ip_send_skb+0x32/0x140 net/ipv4/ip_output.c:1502
 udp_send_skb+0x6e3/0xa40 net/ipv4/udp.c:1197
 udp_sendmsg+0x1050/0x13b0 net/ipv4/udp.c:1485
 inet_sendmsg+0xac/0xd0 net/ipv4/af_inet.c:851
 sock_sendmsg_nosec net/socket.c:712 [inline]
 __sock_sendmsg+0x102/0x180 net/socket.c:727
 ____sys_sendmsg+0x345/0x4e0 net/socket.c:2566
 ___sys_sendmsg+0x17b/0x1d0 net/socket.c:2620
 __sys_sendmmsg+0x178/0x300 net/socket.c:2709
 __do_sys_sendmmsg net/socket.c:2736 [inline]
 __se_sys_sendmmsg net/socket.c:2733 [inline]
 __x64_sys_sendmmsg+0x57/0x70 net/socket.c:2733
 x64_sys_call+0x2f2f/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:308
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00000000 -> 0x00000001

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 13687 Comm: syz.9.22917 Not tainted 6.15.0-syzkaller-10820-gcd2e103d57e5 #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
==================================================================
IPVS: dh: UDP 224.0.0.2:0 - no destination available

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/02 08:35 upstream cd2e103d57e5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in ip_vs_add_service / ip_vs_out_hook
2025/05/18 23:09 upstream a5806cd506af f41472b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in ip_vs_add_service / ip_vs_out_hook
2025/04/29 04:04 upstream f15d97df5afa aeb6ec69 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in ip_vs_add_service / ip_vs_out_hook
2025/04/20 00:02 upstream 8560697b23dc 2a20f901 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in ip_vs_add_service / ip_vs_out_hook
* Struck through repros no longer work on HEAD.