syzbot


DATA RACE in buffer.(*View).Write

Status: fixed on 2024/10/04 03:18
Fix commit: a446b45d4d05 Ensure views returned by PullUp are owned exclusively by their packet.
First crash: 132d, last: 132d

Sample crash report:
WARNING: DATA RACE
Read at 0x00c0010e4810 by goroutine 14711:
  runtime.slicecopy()
      GOROOT/src/runtime/slice.go:325 +0x0
  gvisor.dev/gvisor/pkg/buffer.(*View).Write()
      pkg/buffer/view.go:253 +0x2fe
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).handleICMP()
      pkg/tcpip/network/ipv4/icmp.go:417 +0xf13
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).deliverPacketLocally()
      pkg/tcpip/network/ipv4/ipv4.go:1300 +0xd89
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).handleValidatedPacket()
      pkg/tcpip/network/ipv4/ipv4.go:1144 +0x988
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).HandlePacket()
      pkg/tcpip/network/ipv4/ipv4.go:872 +0x5c9
  gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).DeliverNetworkPacket()
      pkg/tcpip/stack/nic.go:769 +0x1ea
  gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/nested/nested.go:61 +0xc1
  gvisor.dev/gvisor/pkg/tcpip/link/packetsocket.(*endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/packetsocket/packetsocket.go:47 +0x5e
  gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/nested/nested.go:61 +0xc1
  gvisor.dev/gvisor/pkg/tcpip/link/ethernet.(*Endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/ethernet/ethernet.go:82 +0x329
  gvisor.dev/gvisor/pkg/tcpip/link/veth.(*Endpoint).InjectInbound()
      pkg/tcpip/link/veth/veth.go:129 +0xc1
  gvisor.dev/gvisor/pkg/tcpip/link/veth.NewPair.func1()
      pkg/tcpip/link/veth/veth.go:108 +0xca

Previous write at 0x00c0010e4810 by goroutine 14712:
  encoding/binary.bigEndian.PutUint16()
      GOROOT/src/encoding/binary/binary.go:149 +0x9a4
  gvisor.dev/gvisor/pkg/tcpip/header.IPv4.SetTotalLength()
      pkg/tcpip/header/ipv4.go:426 +0x911
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).deliverPacketLocally()
      pkg/tcpip/network/ipv4/ipv4.go:1284 +0x8d4
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).handleValidatedPacket()
      pkg/tcpip/network/ipv4/ipv4.go:1144 +0x988
  gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).HandlePacket()
      pkg/tcpip/network/ipv4/ipv4.go:872 +0x5c9
  gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).DeliverNetworkPacket()
      pkg/tcpip/stack/nic.go:769 +0x1ea
  gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/nested/nested.go:61 +0xc1
  gvisor.dev/gvisor/pkg/tcpip/link/packetsocket.(*endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/packetsocket/packetsocket.go:47 +0x5e
  gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/nested/nested.go:61 +0xc1
  gvisor.dev/gvisor/pkg/tcpip/link/ethernet.(*Endpoint).DeliverNetworkPacket()
      pkg/tcpip/link/ethernet/ethernet.go:82 +0x329
  gvisor.dev/gvisor/pkg/tcpip/link/veth.(*Endpoint).InjectInbound()
      pkg/tcpip/link/veth/veth.go:129 +0xc1
  gvisor.dev/gvisor/pkg/tcpip/link/veth.NewPair.func1()
      pkg/tcpip/link/veth/veth.go:108 +0xca

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/16 20:10 gvisor 940cd91305ed 215bec2d .config console log report info ci-gvisor-ptrace-1-race-cover DATA RACE in buffer.(*View).Write
* Struck through repros no longer work on HEAD.