syzbot


DATA RACE in tcp.(*endpoint).bindLocked

Status: fixed on 2020/09/09 17:36
Fix commit: 38cdb0579b69 Fix data race in tcp.GetSockOpt.
First crash: 1545d, last: 1545d

Sample crash report:
WARNING: DATA RACE
Write at 0x00c00088e008 by goroutine 345:
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).bindLocked()
      pkg/tcpip/transport/tcp/endpoint.go:2551 +0x51a
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).listen()
      pkg/tcpip/transport/tcp/endpoint.go:2410 +0xa11
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).Listen()
      pkg/tcpip/transport/tcp/endpoint.go:2360 +0x60
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*socketOpsCommon).Listen()
      pkg/sentry/socket/netstack/netstack.go:828 +0x66
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*SocketOperations).Listen()
      <autogenerated>:1 +0x57
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Listen()
      pkg/sentry/syscalls/linux/sys_socket.go:406 +0x1b8
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:103 +0x44d
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:238 +0xb4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:198 +0x109
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:173 +0x1e7
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:275 +0x11d8
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:93 +0x31c

Previous read at 0x00c00088e008 by goroutine 213:
  gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).GetSockOpt()
      pkg/tcpip/transport/tcp/endpoint.go:2023 +0x14e
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.getSockOptIP()
      pkg/sentry/socket/netstack/netstack.go:1638 +0x1746
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.GetSockOpt()
      pkg/sentry/socket/netstack/netstack.go:979 +0x1e5
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*SocketOperations).GetSockOpt()
      pkg/sentry/socket/netstack/netstack.go:962 +0x4ce
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.getSockOpt()
      pkg/sentry/syscalls/linux/sys_socket.go:514 +0xd6
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.GetSockOpt()
      pkg/sentry/syscalls/linux/sys_socket.go:468 +0x2b6
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:103 +0x44d
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:238 +0xb4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:198 +0x109
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:173 +0x1e7
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:275 +0x11d8
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:93 +0x31c

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/09/02 17:30 gvisor 563f28b7d56c abf9ba4f .config console log report syz ci-gvisor-ptrace-proxy-sandbox-race
2020/09/02 17:16 gvisor 563f28b7d56c abf9ba4f .config console log report ci-gvisor-ptrace-proxy-sandbox-race
* Struck through repros no longer work on HEAD.