syzbot


DATA RACE in stack.(*NIC).DeliverNetworkPacket

Status: fixed on 2020/12/30 01:06
Fix commit: 25ebddbddfbc Fix a data race in packetEPs
First crash: 1452d, last: 1444d

Sample crash report:
WARNING: DATA RACE
Write at 0x00c00b7d5aa0 by goroutine 1525:
  runtime.slicecopy()
      GOROOT/src/runtime/slice.go:246 +0x0
  gvisor.dev/gvisor/pkg/tcpip/stack.(*NIC).DeliverNetworkPacket()
      pkg/tcpip/stack/nic.go:643 +0x3c9
  gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/nested/nested.go:59 +0xef
  gvisor.dev/gvisor/pkg/tcpip/link/sniffer.(*endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/sniffer/sniffer.go:143 +0xae
  gvisor.dev/gvisor/pkg/tcpip/link/loopback.(*endpoint).WritePacket()
      pkg/tcpip/link/loopback/loopback.go:89 +0x221
  gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).WritePacket()
      pkg/tcpip/link/nested/nested.go:117 +0xb0
  gvisor.dev/gvisor/pkg/tcpip/link/sniffer.(*endpoint).WritePacket()
      pkg/tcpip/link/sniffer/sniffer.go:192 +0x65
  gvisor.dev/gvisor/pkg/tcpip/stack.(*NIC).writePacket()
      pkg/tcpip/stack/nic.go:296 +0xba
  gvisor.dev/gvisor/pkg/tcpip/stack.(*NIC).WritePacket()
      pkg/tcpip/stack/nic.go:280 +0x172
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).writePacket()
      pkg/tcpip/network/ipv4/ipv4.go:352 +0x201
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).WritePacket()
      pkg/tcpip/network/ipv4/ipv4.go:315 +0x2d0
  gvisor.dev/gvisor/pkg/tcpip/stack.(*Route).WritePacket()
      pkg/tcpip/stack/route.go:389 +0x132
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.sendTCP()
      pkg/tcpip/transport/tcp/connect.go:886 +0x4b0
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).sendTCP()
      pkg/tcpip/transport/tcp/connect.go:777 +0x14e
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).sendRaw()
      pkg/tcpip/transport/tcp/connect.go:943 +0x2f9
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).resetConnectionLocked()
      pkg/tcpip/transport/tcp/connect.go:1018 +0x273
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).protocolMainLoop.func6()
      pkg/tcpip/transport/tcp/connect.go:1552 +0x171
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).protocolMainLoop()
      pkg/tcpip/transport/tcp/connect.go:1586 +0x8f7

Previous read at 0x00c00b7d5aa0 by goroutine 1605:
  gvisor.dev/gvisor/pkg/tcpip/stack.(*NIC).DeliverNetworkPacket()
      pkg/tcpip/stack/nic.go:645 +0x424
  gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/nested/nested.go:59 +0xef
  gvisor.dev/gvisor/pkg/tcpip/link/sniffer.(*endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/sniffer/sniffer.go:143 +0xae
  gvisor.dev/gvisor/pkg/tcpip/link/loopback.(*endpoint).WritePacket()
      pkg/tcpip/link/loopback/loopback.go:89 +0x221
  gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).WritePacket()
      pkg/tcpip/link/nested/nested.go:117 +0xb0
  gvisor.dev/gvisor/pkg/tcpip/link/sniffer.(*endpoint).WritePacket()
      pkg/tcpip/link/sniffer/sniffer.go:192 +0x65
  gvisor.dev/gvisor/pkg/tcpip/stack.(*NIC).writePacket()
      pkg/tcpip/stack/nic.go:296 +0xba
  gvisor.dev/gvisor/pkg/tcpip/stack.(*NIC).WritePacket()
      pkg/tcpip/stack/nic.go:280 +0x172
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).writePacket()
      pkg/tcpip/network/ipv4/ipv4.go:352 +0x201
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).WritePacket()
      pkg/tcpip/network/ipv4/ipv4.go:315 +0x2d0
  gvisor.dev/gvisor/pkg/tcpip/stack.(*Route).WritePacket()
      pkg/tcpip/stack/route.go:389 +0x132
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.sendTCP()
      pkg/tcpip/transport/tcp/connect.go:886 +0x4b0
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).sendTCP()
      pkg/tcpip/transport/tcp/connect.go:777 +0x14e
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).sendRaw()
      pkg/tcpip/transport/tcp/connect.go:943 +0x2f9
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).resetConnectionLocked()
      pkg/tcpip/transport/tcp/connect.go:1018 +0x273
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).protocolMainLoop.func6()
      pkg/tcpip/transport/tcp/connect.go:1552 +0x171
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).protocolMainLoop()
      pkg/tcpip/transport/tcp/connect.go:1586 +0x8f7

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/13 06:26 gvisor 08d36b6c6308 bca53db9 .config console log report info ci-gvisor-ptrace-2-race
2020/12/08 04:31 gvisor eeb23531ebef 51a9082e .config console log report info ci-gvisor-ptrace-2-race
2020/12/06 01:22 gvisor 3075ede86edf 50503117 .config console log report info ci-gvisor-ptrace-1-race
2020/12/04 19:50 gvisor a78cef0ed7ce 20366b87 .config console log report info ci-gvisor-ptrace-1-race
* Struck through repros no longer work on HEAD.