syzbot


DATA RACE in netstack.(*SocketOperations).fetchReadView

Status: fixed on 2020/03/10 21:06
Fix commit: 42fb7d349137 socket: take readMu to access readView
First crash: 1733d, last: 1727d

Sample crash report:
WARNING: DATA RACE
Write at 0x00c0004184f8 by goroutine 364:
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*SocketOperations).fetchReadView()
      pkg/sentry/socket/netstack/netstack.go:418 +0x85
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*SocketOperations).nonBlockingRead()
      pkg/sentry/socket/netstack/netstack.go:2388 +0x169
  gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*SocketOperations).RecvMsg()
      pkg/sentry/socket/netstack/netstack.go:2535 +0x715
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.recvFrom()
      pkg/sentry/syscalls/linux/sys_socket.go:871 +0x345
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.RecvFrom()
      pkg/sentry/syscalls/linux/sys_socket.go:896 +0x88
  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
DIAGNOSIS:
I0302 01:26:54.908932   50392 main.go:305] ***************************
I0302 01:26:54.909137   50392 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-0]
I0302 01:26:54.909356   50392 main.go:307] Version release-20200219.0-72-gce4d1e45bb88
I0302 01:26:54.909444   50392 main.go:308] PID: 50392
I0302 01:26:54.909562   50392 main.go:309] UID: 0, GID: 0
I0302 01:26:54.909629   50392 main.go:310] Configuration:
I0302 01:26:54.909713   50392 main.go:311] 		RootDir: /syzkaller/managers/ptrace-proxy-sandbox-race/workdir/gvisor_root
I0302 01:26:54.909833   50392 main.go:312] 		Platform: ptrace
I0302 01:26:54.909937   50392 main.go:313] 		FileAccess: shared, overlay: false
I0302 01:26:54.910025   50392 main.go:314] 		Network: sandbox, logging: false
I0302 01:26:54.910132   50392 main.go:315] 		Strace: false, max size: 1024, syscalls: []
I0302 01:26:54.910226   50392 main.go:316] ***************************
W0302 01:26:54.910303   50392 main.go:321] Block the TERM signal. This is only safe in tests!
D0302 01:26:54.910472   50392 container.go:159] Load container "/syzkaller/managers/ptrace-proxy-sandbox-race/workdir/gvisor_root" "ci-gvisor-ptrace-proxy-sandbox-race-0"
D0302 01:26:54.917348   50392 container.go:592] Signal container "ci-gvisor-ptrace-proxy-sandbox-race-0": signal 0
D0302 01:26:54.917576   50392 sandbox.go:806] Signal sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0"
D0302 01:26:54.917692   50392 sandbox.go:318] Connecting to sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0"
D0302 01:26:54.918202   50392 urpc.go:534] urpc: successfully marshalled 117 bytes.
I0302 01:26:54.995982   50392 debug.go:122] Found sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0", PID: 47680
I0302 01:26:54.996149   50392 debug.go:131] Retrieving sandbox stacks
D0302 01:26:54.996251   50392 sandbox.go:924] Stacks sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0"
D0302 01:26:54.996345   50392 sandbox.go:318] Connecting to sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0"
W0302 01:26:54.996523   50392 error.go:48] FATAL ERROR: retrieving stacks: connecting to control server at PID 47680: connection refused
retrieving stacks: connecting to control server at PID 47680: connection refused
W0302 01:26:54.996867   50392 main.go:338] Failure to execute command, err: 1


Error collecting stacks: failed to run ["/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-0"]: exit status 128
I0302 01:26:54.908932   50392 main.go:305] ***************************
I0302 01:26:54.909137   50392 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-0]
I0302 01:26:54.909356   50392 main.go:307] Version release-20200219.0-72-gce4d1e45bb88
I0302 01:26:54.909444   50392 main.go:308] PID: 50392
I0302 01:26:54.909562   50392 main.go:309] UID: 0, GID: 0
I0302 01:26:54.909629   50392 main.go:310] Configuration:
I0302 01:26:54.909713   50392 main.go:311] 		RootDir: /syzkaller/managers/ptrace-proxy-sandbox-race/workdir/gvisor_root
I0302 01:26:54.909833   50392 main.go:312] 		Platform: ptrace
I0302 01:26:54.909937   50392 main.go:313] 		FileAccess: shared, overlay: false
I0302 01:26:54.910025   50392 main.go:314] 		Network: sandbox, logging: false
I0302 01:26:54.910132   50392 main.go:315] 		Strace: false, max size: 1024, syscalls: []
I0302 01:26:54.910226   50392 main.go:316] ***************************
W0302 01:26:54.910303   50392 main.go:321] Block the TERM signal. This is only safe in tests!
D0302 01:26:54.910472   50392 container.go:159] Load container "/syzkaller/managers/ptrace-proxy-sandbox-race/workdir/gvisor_root" "ci-gvisor-ptrace-proxy-sandbox-race-0"
D0302 01:26:54.917348   50392 container.go:592] Signal container "ci-gvisor-ptrace-proxy-sandbox-race-0": signal 0
D0302 01:26:54.917576   50392 sandbox.go:806] Signal sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0"
D0302 01:26:54.917692   50392 sandbox.go:318] Connecting to sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0"
D0302 01:26:54.918202   50392 urpc.go:534] urpc: successfully marshalled 117 bytes.
I0302 01:26:54.995982   50392 debug.go:122] Found sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0", PID: 47680
I0302 01:26:54.996149   50392 debug.go:131] Retrieving sandbox stacks
D0302 01:26:54.996251   50392 sandbox.go:924] Stacks sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0"
D0302 01:26:54.996345   50392 sandbox.go:318] Connecting to sandbox "ci-gvisor-ptrace-proxy-sandbox-race-0"
W0302 01:26:54.996523   50392 error.go:48] FATAL ERROR: retrieving stacks: connecting to control server at PID 47680: connection refused
retrieving stacks: connecting to control server at PID 47680: connection refused
W0302 01:26:54.996867   50392 main.go:338] Failure to execute command, err: 1
  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

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/02 01:28 gvisor ce4d1e45bb88 c88c7b75 .config console log report syz ci-gvisor-ptrace-proxy-sandbox-race
2020/02/29 18:32 gvisor ce4d1e45bb88 c88c7b75 .config console log report syz ci-gvisor-ptrace-proxy-sandbox-race
2020/02/28 23:13 gvisor c96bb4d2ebc6 c88c7b75 .config console log report syz ci-gvisor-ptrace-proxy-sandbox-race
2020/03/05 01:47 gvisor ce4d1e45bb88 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/03/05 00:27 gvisor ce4d1e45bb88 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/03/03 12:21 gvisor ce4d1e45bb88 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/03/03 02:27 gvisor ce4d1e45bb88 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/03/02 23:26 gvisor ce4d1e45bb88 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/03/02 01:02 gvisor ce4d1e45bb88 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/02/29 18:16 gvisor ce4d1e45bb88 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/02/28 22:46 gvisor c96bb4d2ebc6 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/02/27 21:41 gvisor abf7ebcd38e8 c88c7b75 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
* Struck through repros no longer work on HEAD.