syzbot


KCSAN: data-race in sk_stream_wait_memory / tcp_shifted_skb

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: 1674d, last: 1674d

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

write to 0xffff8880b7e3d6c8 of 4 bytes by interrupt on cpu 0:
 sk_wmem_free_skb include/net/sock.h:1470 [inline]
 tcp_rtx_queue_unlink_and_free include/net/tcp.h:1801 [inline]
 tcp_shifted_skb+0x4f2/0x9f0 net/ipv4/tcp_input.c:1354
 tcp_shift_skb_data net/ipv4/tcp_input.c:1497 [inline]
 tcp_sacktag_walk+0x4e5/0xbe0 net/ipv4/tcp_input.c:1560
 tcp_sacktag_write_queue+0xc23/0x17a0 net/ipv4/tcp_input.c:1822
 tcp_ack+0x2048/0x3170 net/ipv4/tcp_input.c:3664
 tcp_rcv_established+0x37e/0xf50 net/ipv4/tcp_input.c:5696
 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

read to 0xffff8880b7e3d6c8 of 4 bytes by task 28055 on cpu 1:
 __sk_stream_memory_free include/net/sock.h:1210 [inline]
 sk_stream_memory_free include/net/sock.h:1219 [inline]
 sk_stream_wait_memory+0x437/0x7c0 net/core/stream.c:145
 tcp_sendmsg_locked+0xb47/0x1f30 net/ipv4/tcp.c:1393
 tcp_sendmsg+0x39/0x60 net/ipv4/tcp.c:1434
 inet_sendmsg+0x6d/0x90 net/ipv4/af_inet.c:807
 sock_sendmsg_nosec net/socket.c:637 [inline]
 sock_sendmsg+0x9f/0xc0 net/socket.c:657
 __sys_sendto+0x21f/0x320 net/socket.c:1952
 __do_sys_sendto net/socket.c:1964 [inline]
 __se_sys_sendto net/socket.c:1960 [inline]
 __x64_sys_sendto+0x89/0xb0 net/socket.c:1960
 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: 1 PID: 28055 Comm: syz-executor.2 Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/25 13:15 https://github.com/google/ktsan.git kcsan 05f2236801fe 04ca72cd .config console log report ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.