syzbot


DATA RACE in raw.(*endpoint).HandlePacket

Status: fixed on 2020/12/30 01:06
Fix commit: 981faa2c1229 RLock Endpoint in raw.Endpoint.HandlePacket
First crash: 1440d, last: 1440d

Sample crash report:
WARNING: DATA RACE
Read at 0x00c0012da2a9 by goroutine 769:
  gvisor.dev/gvisor/pkg/tcpip/transport/raw.(*endpoint).HandlePacket()
      pkg/tcpip/transport/raw/endpoint.go:664 +0x2a9
  gvisor.dev/gvisor/pkg/tcpip/stack.(*transportDemuxer).deliverRawPacket()
      pkg/tcpip/stack/transport_demuxer.go:590 +0x875
  gvisor.dev/gvisor/pkg/tcpip/stack.(*NIC).DeliverTransportPacket()
      pkg/tcpip/stack/nic.go:758 +0x174
  gvisor.dev/gvisor/pkg/tcpip/network/ipv6.(*endpoint).handlePacket()
      pkg/tcpip/network/ipv6/ipv6.go:1133 +0xafa
  gvisor.dev/gvisor/pkg/tcpip/network/ipv6.(*endpoint).HandlePacket()
      pkg/tcpip/network/ipv6/ipv6.go:782 +0x1c4
  gvisor.dev/gvisor/pkg/tcpip/stack.(*NIC).DeliverNetworkPacket()
      pkg/tcpip/stack/nic.go:722 +0x527
  gvisor.dev/gvisor/pkg/tcpip/link/channel.(*Endpoint).InjectLinkAddr()
      pkg/tcpip/link/channel/channel.go:190 +0x5d9
  gvisor.dev/gvisor/pkg/tcpip/link/tun.(*Device).Write()
      pkg/tcpip/link/tun/device.go:223 +0x2d6
  gvisor.dev/gvisor/pkg/sentry/devices/tundev.(*tunFD).Write()
      pkg/sentry/devices/tundev/tundev.go:146 +0x22a
  gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).Write()
      pkg/sentry/vfs/file_description.go:630 +0x130
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.write()
      pkg/sentry/syscalls/linux/vfs2/read_write.go:364 +0xed
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Write()
      pkg/sentry/syscalls/linux/vfs2/read_write.go:333 +0x2a4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:104 +0x452
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:239 +0xb9
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:199 +0x10e
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:174 +0x1e9
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:282 +0x12a6
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:97 +0x397

Previous write at 0x00c0012da2a9 by goroutine 243:
  gvisor.dev/gvisor/pkg/tcpip/transport/raw.(*endpoint).Connect()
      pkg/tcpip/transport/raw/endpoint.go:451 +0x2ab
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*socketOpsCommon).Connect()
      pkg/sentry/socket/netstack/netstack.go:701 +0x52c
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*SocketVFS2).Connect()
      <autogenerated>:1 +0x84
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Connect()
      pkg/sentry/syscalls/linux/vfs2/socket.go:278 +0x256
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:104 +0x452
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:239 +0xb9
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:199 +0x10e
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:174 +0x1e9
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:282 +0x12a6
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:97 +0x397

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/17 03:25 gvisor b645fcd241a8 04201c06 .config console log report syz C ci-gvisor-ptrace-1-race
2020/12/17 03:53 gvisor b645fcd241a8 04201c06 .config console log report syz ci-gvisor-ptrace-2-race
2020/12/17 03:21 gvisor b645fcd241a8 04201c06 .config console log report syz ci-gvisor-ptrace-2-race
2020/12/17 03:13 gvisor b645fcd241a8 04201c06 .config console log report info ci-gvisor-ptrace-1-race
2020/12/17 03:13 gvisor b645fcd241a8 04201c06 .config console log report info ci-gvisor-ptrace-2-race
* Struck through repros no longer work on HEAD.