syzbot


DATA RACE in udp.(*endpoint).SetSockOptBool

Status: fixed on 2020/03/21 06:35
Reported-by: syzbot+542c88bcdae56afc3151@syzkaller.appspotmail.com
Fix commit: c15b8515eb4a Fix datarace on TransportEndpointInfo.ID and clean up semantics.
First crash: 1727d, last: 1727d

Sample crash report:
WARNING: DATA RACE
Write at 0x00c0001b8a3a by goroutine 352:
  gvisor.dev/gvisor/pkg/tcpip/transport/udp.(*endpoint).SetSockOptBool()
      pkg/tcpip/transport/udp/endpoint.go:533 +0x2fd
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.setSockOptIPv6()
      pkg/sentry/socket/netstack/netstack.go:1815 +0x282
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.SetSockOpt()
      pkg/sentry/socket/netstack/netstack.go:1541 +0x3b3
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*SocketOperations).SetSockOpt()
      pkg/sentry/socket/netstack/netstack.go:1527 +0x6a0
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.SetSockOpt()
      pkg/sentry/syscalls/linux/sys_socket.go:541 +0x2fd
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:170 +0x44d
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:291 +0xb4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:252 +0x109
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:227 +0x1b3
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:232 +0x1aaa
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:92 +0x320

Previous read at 0x00c0001b8a3a by goroutine 340:
  gvisor.dev/gvisor/pkg/tcpip/transport/udp.(*endpoint).checkV4Mapped()
      pkg/tcpip/transport/udp/endpoint.go:931 +0xa9
DIAGNOSIS:
I0305 13:25:10.051259   60119 main.go:305] ***************************
I0305 13:25:10.051396   60119 main.go:306] Args: [/syzkaller/managers/ptrace-proxy-sandbox-race/current/image -root /syzkaller/managers/ptrace-proxy-sandbox-race/workdir/gvisor_root -watchdog-action=panic -network=none -debug -alsologtostderr -platform=ptrace -file-access=shared -network=sandbox -TESTONLY-unsafe-nonroot debug -stacks --ps ci-gvisor-ptrace-proxy-sandbox-race-1]
I0305 13:25:10.051608   60119 main.go:307] Version release-20200219.0-72-gce4d1e45bb88
I0305 13:25:10.051723   60119 main.go:308] PID: 60119
I0305 13:25:10.051807   60119 main.go:309] UID: 0, GID: 0
I0305 13:25:10.051875   60119 main.go:310] Configuration:
I0305 13:25:10.051958   60119 main.go:311] 		RootDir: /syzkaller/managers/ptrace-proxy-sandbox-race/workdir/gvisor_root
I0305 13:25:10.052023   60119 main.go:312] 		Platform: ptrace
I0305 13:25:10.052108   60119 main.go:313] 		FileAccess: shared, overlay: false
I0305 13:25:10.052191   60119 main.go:314] 		Network: sandbox, logging: false
I0305 13:25:10.052270   60119 main.go:315] 		Strace: false, max size: 1024, syscalls: []
I0305 13:25:10.052339   60119 main.go:316] ***************************
W0305 13:25:10.052412   60119 main.go:321] Block the TERM signal. This is only safe in tests!
D0305 13:25:10.052596   60119 container.go:159] Load container "/syzkaller/managers/ptrace-proxy-sandbox-race/workdir/gvisor_root" "ci-gvisor-ptrace-proxy-sandbox-race-1"
D0305 13:25:10.057851   60119 container.go:592] Signal container "ci-gvisor-ptrace-proxy-sandbox-race-1": signal 0
D0305 13:25:10.057999   60119 sandbox.go:806] Signal sandbox "ci-gvisor-ptrace-proxy-sandbox-race-1"
D0305 13:25:10.058068   60119 sandbox.go:318] Connecting to sandbox "ci-gvisor-ptrace-proxy-sandbox-race-1"
D0305 13:25:10.058452   60119 urpc.go:534] urpc: successfully marshalled 117 bytes.
I0305 13:25:10.146924   60119 debug.go:122] Found sandbox "ci-gvisor-ptrace-proxy-sandbox-race-1", PID: 58310
I0305 13:25:10.147118   60119 debug.go:131] Retrieving sandbox stacks
D0305 13:25:10.147264   60119 sandbox.go:924] Stacks sandbox "ci-gvisor-ptrace-proxy-sandbox-race-1"
D0305 13:25:10.147385   60119 sandbox.go:318] Connecting to sandbox "ci-gvisor-ptrace-proxy-sandbox-race-1"
W0305 13:25:10.147539   60119 error.go:48] FATAL ERROR: retrieving stacks: connecting to control server at PID 58310: connection refused
retrieving stacks: connecting to control server at PID 58310: connection refused
W0305 13:25:10.147921   60119 main.go:338] Failure to execute command, err: 1

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/05 13:26 gvisor ce4d1e45bb88 c88c7b75 .config console log report syz ci-gvisor-ptrace-proxy-sandbox-race
2020/03/05 13:17 gvisor ce4d1e45bb88 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
* Struck through repros no longer work on HEAD.