syzbot


KCSAN: data-race in strlcpy / strncpy

Status: auto-closed as invalid on 2022/01/21 10:19
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 379d, last: 350d

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

write to 0xffff88814f6bc75e of 1 bytes by task 4742 on cpu 1:
 strlcpy+0x65/0x80 lib/string.c:143
 __set_task_comm+0x3b/0x110 fs/exec.c:1225
 set_task_comm include/linux/sched.h:1924 [inline]
 __kthread_create_on_node+0x1f6/0x260 kernel/kthread.c:415
 kthread_create_on_node+0x86/0xb0 kernel/kthread.c:453
 init_rescuer+0x10e/0x190 kernel/workqueue.c:4274
 alloc_workqueue+0x853/0xad0 kernel/workqueue.c:4349
 bond_init+0x8b/0x320 drivers/net/bonding/bond_main.c:5871
 register_netdevice+0x404/0x10b0 net/core/dev.c:10266
 bond_newlink+0x3f/0x90 drivers/net/bonding/bond_netlink.c:469
 __rtnl_newlink net/core/rtnetlink.c:3458 [inline]
 rtnl_newlink+0xdae/0x13b0 net/core/rtnetlink.c:3506
 rtnetlink_rcv_msg+0x745/0x7e0 net/core/rtnetlink.c:5571
 netlink_rcv_skb+0x14e/0x250 net/netlink/af_netlink.c:2496
 rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:5589
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x5fc/0x6c0 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x726/0x840 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg net/socket.c:724 [inline]
 ____sys_sendmsg+0x39a/0x510 net/socket.c:2409
 ___sys_sendmsg net/socket.c:2463 [inline]
 __sys_sendmsg+0x195/0x230 net/socket.c:2492
 __do_sys_sendmsg net/socket.c:2501 [inline]
 __se_sys_sendmsg net/socket.c:2499 [inline]
 __x64_sys_sendmsg+0x42/0x50 net/socket.c:2499
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffff88814f6bc75e of 1 bytes by task 4744 on cpu 0:
 strncpy+0x104/0x150 lib/string.c:114
 set_cmdline kernel/trace/trace.c:2199 [inline]
 trace_save_cmdline+0x193/0x1e0 kernel/trace/trace.c:2407
 tracing_record_taskinfo_sched_switch+0x91/0x290 kernel/trace/trace.c:2547
 probe_sched_switch+0x7c/0x90 kernel/trace/trace_sched_switch.c:34
 trace_sched_switch include/trace/events/sched.h:220 [inline]
 __schedule+0x67b/0x6a0 kernel/sched/core.c:6250
 schedule+0x81/0xb0 kernel/sched/core.c:6326
 schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6385
 kthread+0x239/0x2e0 kernel/kthread.c:320
 ret_from_fork+0x1f/0x30

value changed: 0x64 -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 4744 Comm: bond26 Not tainted 5.16.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (8):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2021/12/17 10:10 upstream fa36bbe6d43f 44068e19 .config log report info KCSAN: data-race in strlcpy / strncpy
ci2-upstream-kcsan-gce 2021/12/08 03:28 upstream 2a987e65025e 0230ba3e .config log report info KCSAN: data-race in strlcpy / strncpy
ci2-upstream-kcsan-gce 2021/12/05 21:15 upstream 944207047ca4 a617004c .config log report info KCSAN: data-race in strlcpy / strncpy
ci2-upstream-kcsan-gce 2021/12/05 16:37 upstream 79a72162048e a617004c .config log report info KCSAN: data-race in strlcpy / strncpy
ci2-upstream-kcsan-gce 2021/12/03 15:10 upstream 5f58da2befa5 c7c20675 .config log report info KCSAN: data-race in strlcpy / strncpy
ci2-upstream-kcsan-gce 2021/12/02 13:40 upstream 58e1100fdc59 61f86278 .config log report info KCSAN: data-race in strlcpy / strncpy
ci2-upstream-kcsan-gce 2021/11/28 19:42 upstream 3498e7f2bb41 63eeac02 .config log report info KCSAN: data-race in strlcpy / strncpy
ci2-upstream-kcsan-gce 2021/11/18 08:45 upstream 42eb8fdac2fc cafff8b6 .config log report info KCSAN: data-race in strlcpy / strncpy
* Struck through repros no longer work on HEAD.