summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--pkg/sentry/socket/netlink/socket.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/sentry/socket/netlink/socket.go b/pkg/sentry/socket/netlink/socket.go
index 5b0c11c84..7223773ad 100644
--- a/pkg/sentry/socket/netlink/socket.go
+++ b/pkg/sentry/socket/netlink/socket.go
@@ -291,6 +291,8 @@ func (s *Socket) GetSockOpt(t *kernel.Task, level int, name int, outLen int) (in
if outLen < sizeOfInt32 {
return nil, syserr.ErrInvalidArgument
}
+ s.mu.Lock()
+ defer s.mu.Unlock()
return int32(s.sendBufferSize), nil
case linux.SO_RCVBUF:
@@ -335,7 +337,9 @@ func (s *Socket) SetSockOpt(t *kernel.Task, level int, name int, opt []byte) *sy
} else if size > maxSendBufferSize {
size = maxSendBufferSize
}
+ s.mu.Lock()
s.sendBufferSize = size
+ s.mu.Unlock()
return nil
case linux.SO_RCVBUF:
if len(opt) < sizeOfInt32 {