syzbot


KCSAN: data-race in tcp_add_backlog / tcp_recvmsg

Status: fixed on 2019/11/04 14:50
Subsystems: net
[Documentation on labels]
Fix commit: 8265792bf887 net-backports: net: silence KCSAN warnings around sk_add_backlog() calls
First crash: 1874d, last: 1844d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in tcp_add_backlog / tcp_recvmsg (2) net 47 1805d 1841d 15/28 fixed on 2019/12/13 00:31

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

write to 0xffff88811e8472f8 of 8 bytes by interrupt on cpu 1:
 __sk_add_backlog include/net/sock.h:902 [inline]
 sk_add_backlog include/net/sock.h:933 [inline]
 tcp_add_backlog+0x45a/0xcc0 net/ipv4/tcp_ipv4.c:1756
 tcp_v4_rcv+0x1a60/0x1bb0 net/ipv4/tcp_ipv4.c:1944
 ip_protocol_deliver_rcu+0x4d/0x420 net/ipv4/ip_input.c:204
 ip_local_deliver_finish+0x110/0x140 net/ipv4/ip_input.c:231
 NF_HOOK include/linux/netfilter.h:305 [inline]
 NF_HOOK include/linux/netfilter.h:299 [inline]
 ip_local_deliver+0x133/0x210 net/ipv4/ip_input.c:252
 dst_input include/net/dst.h:442 [inline]
 ip_rcv_finish+0x121/0x160 net/ipv4/ip_input.c:413
 NF_HOOK include/linux/netfilter.h:305 [inline]
 NF_HOOK include/linux/netfilter.h:299 [inline]
 ip_rcv+0x18f/0x1a0 net/ipv4/ip_input.c:523
 __netif_receive_skb_one_core+0xa7/0xe0 net/core/dev.c:5010
 __netif_receive_skb+0x37/0xf0 net/core/dev.c:5124
 netif_receive_skb_internal+0x59/0x190 net/core/dev.c:5214
 napi_skb_finish net/core/dev.c:5677 [inline]
 napi_gro_receive+0x28f/0x330 net/core/dev.c:5710
 receive_buf+0x284/0x30b0 drivers/net/virtio_net.c:1061
 virtnet_receive drivers/net/virtio_net.c:1323 [inline]
 virtnet_poll+0x436/0x7d0 drivers/net/virtio_net.c:1428
 napi_poll net/core/dev.c:6392 [inline]
 net_rx_action+0x3ae/0xa90 net/core/dev.c:6460

read to 0xffff88811e8472f8 of 8 bytes by task 7305 on cpu 0:
 tcp_recvmsg+0x470/0x1a30 net/ipv4/tcp.c:2048
 inet_recvmsg+0xbb/0x250 net/ipv4/af_inet.c:838
 sock_recvmsg_nosec net/socket.c:871 [inline]
 sock_recvmsg net/socket.c:889 [inline]
 sock_recvmsg+0x92/0xb0 net/socket.c:885
 sock_read_iter+0x15f/0x1e0 net/socket.c:967
 call_read_iter include/linux/fs.h:1889 [inline]
 new_sync_read+0x389/0x4f0 fs/read_write.c:414
 __vfs_read+0xb1/0xc0 fs/read_write.c:427
 vfs_read fs/read_write.c:461 [inline]
 vfs_read+0x143/0x2c0 fs/read_write.c:446
 ksys_read+0xd5/0x1b0 fs/read_write.c:587
 __do_sys_read fs/read_write.c:597 [inline]
 __se_sys_read fs/read_write.c:595 [inline]
 __x64_sys_read+0x4c/0x60 fs/read_write.c:595
 do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 7305 Comm: syz-fuzzer Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (17719):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/03 21:29 https://github.com/google/ktsan.git kcsan 05f2236801fe b35fad31 .config console log report ci2-upstream-kcsan-gce
2019/11/03 09:26 https://github.com/google/ktsan.git kcsan 05f2236801fe c9610487 .config console log report ci2-upstream-kcsan-gce
2019/11/02 21:06 https://github.com/google/ktsan.git kcsan 05f2236801fe d603afc9 .config console log report ci2-upstream-kcsan-gce
2019/11/01 18:30 https://github.com/google/ktsan.git kcsan 05f2236801fe 997ccc67 .config console log report ci2-upstream-kcsan-gce
2019/10/30 20:44 https://github.com/google/ktsan.git kcsan 05f2236801fe a41ca8fa .config console log report ci2-upstream-kcsan-gce
2019/10/29 04:11 https://github.com/google/ktsan.git kcsan 05f2236801fe 5ea87a66 .config console log report ci2-upstream-kcsan-gce
2019/10/28 16:08 https://github.com/google/ktsan.git kcsan 05f2236801fe 439d7b14 .config console log report ci2-upstream-kcsan-gce
2019/10/25 23:41 https://github.com/google/ktsan.git kcsan 05f2236801fe 413926c5 .config console log report ci2-upstream-kcsan-gce
2019/10/25 11:36 https://github.com/google/ktsan.git kcsan 05f2236801fe 04ca72cd .config console log report ci2-upstream-kcsan-gce
2019/10/24 07:42 https://github.com/google/ktsan.git kcsan 05f2236801fe d01bb02a .config console log report ci2-upstream-kcsan-gce
2019/10/23 01:58 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/23 01:19 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/23 00:44 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/23 00:20 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 23:50 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 23:30 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 22:58 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 22:23 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 21:43 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 21:08 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 20:14 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 19:48 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 19:15 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 18:50 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 18:16 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 17:45 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 17:17 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 16:43 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 16:05 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 15:50 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 15:18 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 14:49 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 14:24 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 13:50 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 13:27 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 12:51 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 12:19 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 11:54 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 11:24 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 10:55 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 10:20 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 10:00 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 09:25 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 08:47 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 08:19 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 07:51 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/04 15:10 https://github.com/google/ktsan.git kcsan b4bd934316dc c86336cf .config console log report ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.