syzbot


KCSAN: data-race in hash_net4_add / hash_net4_gc_do

Status: upstream: reported on 2025/04/04 07:30
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+78974ef5957119ce0f61@syzkaller.appspotmail.com
First crash: 22h37m, last: 22h37m
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernel?] KCSAN: data-race in hash_net4_add / hash_net4_gc_do 0 (1) 2025/04/04 07:30

Sample crash report:
EXT4-fs (loop2): 1 truncate cleaned up
ext4 filesystem being mounted at /376/file0 supports timestamps until 2038-01-19 (0x7fffffff)
==================================================================
BUG: KCSAN: data-race in hash_net4_add / hash_net4_gc_do

read-write to 0xffff888120381268 of 4 bytes by task 23 on cpu 1:
 hash_net4_gc_do+0x908/0xf90 net/netfilter/ipset/ip_set_hash_gen.h:518
 hash_net4_gc+0x10d/0x280 net/netfilter/ipset/ip_set_hash_gen.h:583
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0x4de/0xa20 kernel/workqueue.c:3319
 worker_thread+0x52c/0x710 kernel/workqueue.c:3400
 kthread+0x4b7/0x540 kernel/kthread.c:464
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

read to 0xffff888120381268 of 4 bytes by task 9403 on cpu 0:
 hash_net4_add+0x292/0x1d50 net/netfilter/ipset/ip_set_hash_gen.h:869
 hash_net4_uadt+0x51d/0x5d0 net/netfilter/ipset/ip_set_hash_net.c:202
 call_ad+0x1a3/0x550 net/netfilter/ipset/ip_set_core.c:1751
 ip_set_ad+0x5a7/0x670 net/netfilter/ipset/ip_set_core.c:1841
 ip_set_uadd+0x41/0x50 net/netfilter/ipset/ip_set_core.c:1864
 nfnetlink_rcv_msg+0x4ba/0x580 net/netfilter/nfnetlink.c:302
 netlink_rcv_skb+0x12f/0x230 net/netlink/af_netlink.c:2534
 nfnetlink_rcv+0x187/0x1610 net/netfilter/nfnetlink.c:667
 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline]
 netlink_unicast+0x605/0x6c0 net/netlink/af_netlink.c:1339
 netlink_sendmsg+0x609/0x720 net/netlink/af_netlink.c:1883
 sock_sendmsg_nosec net/socket.c:712 [inline]
 __sock_sendmsg+0x140/0x180 net/socket.c:727
 ____sys_sendmsg+0x350/0x4e0 net/socket.c:2566
 ___sys_sendmsg net/socket.c:2620 [inline]
 __sys_sendmsg+0x1a0/0x240 net/socket.c:2652
 __do_sys_sendmsg net/socket.c:2657 [inline]
 __se_sys_sendmsg net/socket.c:2655 [inline]
 __x64_sys_sendmsg+0x46/0x50 net/socket.c:2655
 x64_sys_call+0x26f3/0x2e10 arch/x86/include/generated/asm/syscalls_64.h:47
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x000003f4 -> 0x00000331

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 9403 Comm: syz.2.1855 Not tainted 6.14.0-syzkaller-12966-ga2cc6ff5ec8f #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
==================================================================
Set syz1 is full, maxelem 65536 reached

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/03 23:54 upstream a2cc6ff5ec8f d7ae3a11 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in hash_net4_add / hash_net4_gc_do
* Struck through repros no longer work on HEAD.