syzbot


KCSAN: data-race in tcp_ack / tcp_poll (2)

Status: fixed on 2019/11/07 04:50
Subsystems: net
[Documentation on labels]
Fix commit: ab4e846a82d0 tcp: annotate sk->sk_wmem_queued lockless reads
First crash: 1701d, last: 1689d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in tcp_ack / tcp_poll net 4 1706d 1715d 0/27 closed as invalid on 2019/10/15 15:50

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

write to 0xffff8881216be188 of 4 bytes by interrupt on cpu 1:
 sk_wmem_free_skb include/net/sock.h:1470 [inline]
 tcp_rtx_queue_unlink_and_free include/net/tcp.h:1801 [inline]
 tcp_clean_rtx_queue net/ipv4/tcp_input.c:3161 [inline]
 tcp_ack+0xf2c/0x3170 net/ipv4/tcp_input.c:3688
 tcp_rcv_established+0xd3d/0xf50 net/ipv4/tcp_input.c:5622
 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 0xffff8881216be188 of 4 bytes by task 7185 on cpu 0:
 sk_stream_wspace include/net/sock.h:886 [inline]
 __sk_stream_is_writeable include/net/sock.h:1224 [inline]
 sk_stream_is_writeable include/net/sock.h:1230 [inline]
 tcp_poll+0x422/0x6b0 net/ipv4/tcp.c:558
 sock_poll+0xed/0x250 net/socket.c:1256
 vfs_poll include/linux/poll.h:90 [inline]
 do_select+0x7d0/0x1020 fs/select.c:534
 core_sys_select+0x381/0x550 fs/select.c:677
 kern_select+0x106/0x170 fs/select.c:718
 __do_sys_select fs/select.c:725 [inline]
 __se_sys_select fs/select.c:722 [inline]
 __x64_sys_select+0x70/0x90 fs/select.c:722
 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: 7185 Comm: sshd Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/30 09:10 https://github.com/google/ktsan.git kcsan 05f2236801fe 5ea87a66 .config console log report ci2-upstream-kcsan-gce
2019/10/27 22:19 https://github.com/google/ktsan.git kcsan 05f2236801fe 25bb509e .config console log report ci2-upstream-kcsan-gce
2019/10/24 02:15 https://github.com/google/ktsan.git kcsan 05f2236801fe b602d64b .config console log report ci2-upstream-kcsan-gce
2019/10/22 21:49 https://github.com/google/ktsan.git kcsan 05f2236801fe 4ee855e7 .config console log report ci2-upstream-kcsan-gce
2019/10/19 02:05 https://github.com/google/ktsan.git kcsan 05f2236801fe 8c88c9c1 .config console log report ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.