summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorBhasker Hariharan <bhaskerh@google.com>2020-03-23 16:05:29 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-23 16:06:33 -0700
commit369cf38bd7186da97e134538cd4839a8a4d1aa2c (patch)
tree5e5ce02261819d8b901e8fecd4cddd9c635d3c52 /pkg
parent6eebaea94936ffefd3603ff16ad2225856313fa3 (diff)
Fix data race in SetSockOpt.
PiperOrigin-RevId: 302539171
Diffstat (limited to 'pkg')
-rw-r--r--pkg/sentry/socket/netstack/netstack.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/socket/netstack/netstack.go b/pkg/sentry/socket/netstack/netstack.go
index a6ef7a47e..c19f5639b 100644
--- a/pkg/sentry/socket/netstack/netstack.go
+++ b/pkg/sentry/socket/netstack/netstack.go
@@ -2382,9 +2382,9 @@ func (s *SocketOperations) nonBlockingRead(ctx context.Context, dst usermem.IOSe
// caller-supplied buffer.
s.readMu.Lock()
n, err := s.coalescingRead(ctx, dst, trunc)
- s.readMu.Unlock()
cmsg := s.controlMessages()
s.fillCmsgInq(&cmsg)
+ s.readMu.Unlock()
return n, 0, nil, 0, cmsg, err
}