syzbot


KCSAN: data-race in strscpy / strscpy

Status: auto-closed as invalid on 2022/05/25 16:47
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 222d, last: 222d

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

write to 0xffff888129cfaf18 of 8 bytes by task 15584 on cpu 0:
 strscpy+0xa8/0x170 lib/string.c:210
 strscpy_pad+0x23/0x80 lib/string_helpers.c:788
 __set_task_comm+0x3b/0x110 fs/exec.c:1232
 set_task_comm include/linux/sched.h:1949 [inline]
 __kthread_create_on_node+0x2aa/0x320 kernel/kthread.c:474
 kthread_create_on_node+0x86/0xb0 kernel/kthread.c:512
 init_rescuer+0x10e/0x190 kernel/workqueue.c:4265
 alloc_workqueue+0x839/0xad0 kernel/workqueue.c:4340
 wg_newlink+0x1f1/0x4c0 drivers/net/wireguard/device.c:345
 __rtnl_newlink net/core/rtnetlink.c:3483 [inline]
 rtnl_newlink+0xdc0/0x1580 net/core/rtnetlink.c:3531
 rtnetlink_rcv_msg+0x74f/0x7e0 net/core/rtnetlink.c:5993
 netlink_rcv_skb+0x13e/0x240 net/netlink/af_netlink.c:2496
 rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:6011
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x58a/0x660 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x661/0x750 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec net/socket.c:705 [inline]
 sock_sendmsg net/socket.c:725 [inline]
 ____sys_sendmsg+0x38f/0x500 net/socket.c:2413
 ___sys_sendmsg net/socket.c:2467 [inline]
 __sys_sendmsg+0x195/0x230 net/socket.c:2496
 __do_sys_sendmsg net/socket.c:2505 [inline]
 __se_sys_sendmsg net/socket.c:2503 [inline]
 __x64_sys_sendmsg+0x42/0x50 net/socket.c:2503
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffff888129cfaf19 of 1 bytes by task 15594 on cpu 1:
 strscpy+0xdf/0x170 lib/string.c:219
 ____bpf_get_current_comm kernel/bpf/helpers.c:229 [inline]
 bpf_get_current_comm+0x42/0x70 kernel/bpf/helpers.c:221
 ___bpf_prog_run+0x278/0x2d40 kernel/bpf/core.c:1835
 __bpf_prog_run32+0x70/0xa0 kernel/bpf/core.c:2062
 bpf_dispatcher_nop_func include/linux/bpf.h:804 [inline]
 __bpf_prog_run include/linux/filter.h:628 [inline]
 bpf_prog_run include/linux/filter.h:635 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2022 [inline]
 bpf_trace_run4+0x6d/0x100 kernel/trace/bpf_trace.c:2061
 __traceiter_sched_switch+0x45/0x60 include/trace/events/sched.h:222
 trace_sched_switch include/trace/events/sched.h:222 [inline]
 __schedule+0x69f/0x6c0 kernel/sched/core.c:6385
 schedule+0x71/0xa0 kernel/sched/core.c:6460
 schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6519
 kthread+0x129/0x1e0 kernel/kthread.c:369
 ret_from_fork+0x1f/0x30

value changed: 0x74 -> 0x67

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 15594 Comm: wg-crypt-wiregu Not tainted 5.18.0-rc3-syzkaller-00007-g559089e0a93d-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/04/20 16:45 upstream 559089e0a93d d4befee1 .config log report info KCSAN: data-race in strscpy / strscpy
* Struck through repros no longer work on HEAD.