syzbot


DATA RACE in binary.bigEndian.PutUint16 (2)

Status: fixed on 2024/07/12 23:43
Fix commit: bd58900fba9e Change veth WritePackets to deep clone its list of packets.
First crash: 147d, last: 138d

Sample crash report:
WARNING: DATA RACE
Read at 0x00c009080811 by goroutine 106635:
  encoding/binary.bigEndian.PutUint16()
      GOROOT/src/encoding/binary/binary.go:148 +0x997
  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

Previous write at 0x00c009080811 by goroutine 106634:
  encoding/binary.bigEndian.PutUint16()
      GOROOT/src/encoding/binary/binary.go:150 +0x9d0
  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 (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/11 03:54 gvisor 2d9b51ec34e2 c699c2eb .config console log report info ci-gvisor-ptrace-2-race-cover DATA RACE in binary.bigEndian.PutUint16
2024/07/01 18:59 gvisor d59375d82e63 b294e901 .config console log report info ci-gvisor-systrap-1-race DATA RACE in binary.bigEndian.PutUint16
2024/07/01 18:45 gvisor d59375d82e63 b294e901 .config console log report info ci-gvisor-ptrace-1-race DATA RACE in binary.bigEndian.PutUint16
* Struck through repros no longer work on HEAD.