syzbot


KCSAN: data-race in tcp_poll / tcp_queue_rcv

Status: fixed on 2019/11/04 14:50
Subsystems: net
[Documentation on labels]
Fix commit: dba7d9b8c739 net-backports: tcp: annotate tp->rcv_nxt lockless reads
First crash: 1830d, last: 1799d

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

write to 0xffff8881241c85f8 of 4 bytes by interrupt on cpu 1:
 tcp_rcv_nxt_update net/ipv4/tcp_input.c:3365 [inline]
 tcp_queue_rcv+0xe9/0x380 net/ipv4/tcp_input.c:4682
 tcp_rcv_established+0xbf1/0xf50 net/ipv4/tcp_input.c:5660
 tcp_v4_do_rcv+0x381/0x4e0 net/ipv4/tcp_ipv4.c:1561
 tcp_v4_rcv+0x19dc/0x1bb0 net/ipv4/tcp_ipv4.c:1942
 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

read to 0xffff8881241c85f8 of 4 bytes by task 7214 on cpu 0:
 tcp_stream_is_readable net/ipv4/tcp.c:480 [inline]
 tcp_poll+0x204/0x6b0 net/ipv4/tcp.c:554
 sock_poll+0xed/0x250 net/socket.c:1256
 vfs_poll include/linux/poll.h:90 [inline]
 ep_item_poll.isra.0+0x90/0x190 fs/eventpoll.c:892
 ep_send_events_proc+0x113/0x590 fs/eventpoll.c:1749
 ep_scan_ready_list.constprop.0+0x189/0x500 fs/eventpoll.c:704
 ep_send_events fs/eventpoll.c:1793 [inline]
 ep_poll+0xe3/0x900 fs/eventpoll.c:1930
 do_epoll_wait+0x162/0x180 fs/eventpoll.c:2294
 __do_sys_epoll_pwait fs/eventpoll.c:2325 [inline]
 __se_sys_epoll_pwait fs/eventpoll.c:2311 [inline]
 __x64_sys_epoll_pwait+0xcd/0x180 fs/eventpoll.c:2311
 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: 7214 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 (1897):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/04 12:05 https://github.com/google/ktsan.git kcsan 05f2236801fe 18e12644 .config console log report ci2-upstream-kcsan-gce
2019/11/03 21:32 https://github.com/google/ktsan.git kcsan 05f2236801fe b35fad31 .config console log report ci2-upstream-kcsan-gce
2019/11/03 09:27 https://github.com/google/ktsan.git kcsan 05f2236801fe c9610487 .config console log report ci2-upstream-kcsan-gce
2019/11/02 21:09 https://github.com/google/ktsan.git kcsan 05f2236801fe d603afc9 .config console log report ci2-upstream-kcsan-gce
2019/11/01 18:36 https://github.com/google/ktsan.git kcsan 05f2236801fe 997ccc67 .config console log report ci2-upstream-kcsan-gce
2019/10/30 20:48 https://github.com/google/ktsan.git kcsan 05f2236801fe a41ca8fa .config console log report ci2-upstream-kcsan-gce
2019/10/29 04:15 https://github.com/google/ktsan.git kcsan 05f2236801fe 5ea87a66 .config console log report ci2-upstream-kcsan-gce
2019/10/28 16:16 https://github.com/google/ktsan.git kcsan 05f2236801fe 439d7b14 .config console log report ci2-upstream-kcsan-gce
2019/10/26 11:42 https://github.com/google/ktsan.git kcsan 05f2236801fe 25bb509e .config console log report ci2-upstream-kcsan-gce
2019/10/25 23:48 https://github.com/google/ktsan.git kcsan 05f2236801fe 413926c5 .config console log report ci2-upstream-kcsan-gce
2019/10/25 11:42 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 14:21 https://github.com/google/ktsan.git kcsan 05f2236801fe b602d64b .config console log report ci2-upstream-kcsan-gce
2019/10/23 01:47 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/23 01:39 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/23 00:33 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 23:31 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 22:25 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 21:25 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 20:03 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 19:56 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 18:53 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 17:51 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 16:50 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 16:15 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/22 14:40 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .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 11:44 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 11:11 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 10:07 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 08:57 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 07:54 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 06:37 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 06:26 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 05:17 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 03:40 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 03:31 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 02:25 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/22 01:04 https://github.com/google/ktsan.git kcsan 05f2236801fe c59a7cd8 .config console log report ci2-upstream-kcsan-gce
2019/10/21 23:39 https://github.com/google/ktsan.git kcsan 05f2236801fe b24d2b8a .config console log report ci2-upstream-kcsan-gce
2019/10/21 22:18 https://github.com/google/ktsan.git kcsan 05f2236801fe b24d2b8a .config console log report ci2-upstream-kcsan-gce
2019/10/21 21:18 https://github.com/google/ktsan.git kcsan 05f2236801fe b24d2b8a .config console log report ci2-upstream-kcsan-gce
2019/10/21 20:09 https://github.com/google/ktsan.git kcsan 05f2236801fe b24d2b8a .config console log report ci2-upstream-kcsan-gce
2019/10/21 18:52 https://github.com/google/ktsan.git kcsan 05f2236801fe b24d2b8a .config console log report ci2-upstream-kcsan-gce
2019/10/21 17:53 https://github.com/google/ktsan.git kcsan 05f2236801fe b24d2b8a .config console log report ci2-upstream-kcsan-gce
2019/10/21 16:09 https://github.com/google/ktsan.git kcsan 05f2236801fe b24d2b8a .config console log report ci2-upstream-kcsan-gce
2019/10/21 14:59 https://github.com/google/ktsan.git kcsan 05f2236801fe b24d2b8a .config console log report ci2-upstream-kcsan-gce
2019/10/04 15:42 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.