syzbot


KCSAN: data-race in sk_stream_wait_memory / tcp_fragment

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

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

write to 0xffff8880ab092208 of 4 bytes by interrupt on cpu 1:
 tcp_fragment+0x1b2/0x900 net/ipv4/tcp_output.c:1336
 __tcp_retransmit_skb+0x597/0x15f0 net/ipv4/tcp_output.c:2929
 tcp_retransmit_skb+0x36/0x1a0 net/ipv4/tcp_output.c:2999
 tcp_xmit_retransmit_queue+0x23c/0x5a0 net/ipv4/tcp_output.c:3080
 tcp_tsq_write.part.0+0x153/0x160 net/ipv4/tcp_output.c:796
 tcp_tsq_write net/ipv4/tcp_output.c:788 [inline]
 tcp_tsq_handler+0x85/0xe0 net/ipv4/tcp_output.c:808
 tcp_pace_kick+0x27/0x70 net/ipv4/tcp_output.c:972
 __run_hrtimer kernel/time/hrtimer.c:1514 [inline]
 __hrtimer_run_queues+0x288/0x600 kernel/time/hrtimer.c:1576
 hrtimer_run_softirq+0x10e/0x150 kernel/time/hrtimer.c:1593
 __do_softirq+0x115/0x33f kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0xbb/0xe0 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:536 [inline]
 smp_apic_timer_interrupt+0xe6/0x280 arch/x86/kernel/apic/apic.c:1137
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830
 arch_local_irq_restore arch/x86/include/asm/paravirt.h:756 [inline]
 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline]
 _raw_spin_unlock_irqrestore+0x51/0x80 kernel/locking/spinlock.c:191

read to 0xffff8880ab092208 of 4 bytes by task 9738 on cpu 0:
 __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: 0 PID: 9738 Comm: syz-executor.0 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/11/03 12:23 https://github.com/google/ktsan.git kcsan 05f2236801fe c9610487 .config console log report ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.