summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/socket/netlink
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/socket/netlink')
-rw-r--r--pkg/sentry/socket/netlink/netlink_state_autogen.go7
-rw-r--r--pkg/sentry/socket/netlink/socket.go12
2 files changed, 4 insertions, 15 deletions
diff --git a/pkg/sentry/socket/netlink/netlink_state_autogen.go b/pkg/sentry/socket/netlink/netlink_state_autogen.go
index 5c97816d0..307498c1c 100644
--- a/pkg/sentry/socket/netlink/netlink_state_autogen.go
+++ b/pkg/sentry/socket/netlink/netlink_state_autogen.go
@@ -44,7 +44,6 @@ func (s *socketOpsCommon) StateFields() []string {
"bound",
"portID",
"sendBufferSize",
- "passcred",
"filter",
}
}
@@ -62,8 +61,7 @@ func (s *socketOpsCommon) StateSave(stateSinkObject state.Sink) {
stateSinkObject.Save(6, &s.bound)
stateSinkObject.Save(7, &s.portID)
stateSinkObject.Save(8, &s.sendBufferSize)
- stateSinkObject.Save(9, &s.passcred)
- stateSinkObject.Save(10, &s.filter)
+ stateSinkObject.Save(9, &s.filter)
}
func (s *socketOpsCommon) afterLoad() {}
@@ -78,8 +76,7 @@ func (s *socketOpsCommon) StateLoad(stateSourceObject state.Source) {
stateSourceObject.Load(6, &s.bound)
stateSourceObject.Load(7, &s.portID)
stateSourceObject.Load(8, &s.sendBufferSize)
- stateSourceObject.Load(9, &s.passcred)
- stateSourceObject.Load(10, &s.filter)
+ stateSourceObject.Load(9, &s.filter)
}
func (k *kernelSCM) StateTypeName() string {
diff --git a/pkg/sentry/socket/netlink/socket.go b/pkg/sentry/socket/netlink/socket.go
index 3baad098b..057f4d294 100644
--- a/pkg/sentry/socket/netlink/socket.go
+++ b/pkg/sentry/socket/netlink/socket.go
@@ -120,9 +120,6 @@ type socketOpsCommon struct {
// fixed buffer but only consume this many bytes.
sendBufferSize uint32
- // passcred indicates if this socket wants SCM credentials.
- passcred bool
-
// filter indicates that this socket has a BPF filter "installed".
//
// TODO(gvisor.dev/issue/1119): We don't actually support filtering,
@@ -201,10 +198,7 @@ func (s *socketOpsCommon) EventUnregister(e *waiter.Entry) {
// Passcred implements transport.Credentialer.Passcred.
func (s *socketOpsCommon) Passcred() bool {
- s.mu.Lock()
- passcred := s.passcred
- s.mu.Unlock()
- return passcred
+ return s.ep.SocketOptions().GetPassCred()
}
// ConnectedPasscred implements transport.Credentialer.ConnectedPasscred.
@@ -419,9 +413,7 @@ func (s *socketOpsCommon) SetSockOpt(t *kernel.Task, level int, name int, opt []
}
passcred := usermem.ByteOrder.Uint32(opt)
- s.mu.Lock()
- s.passcred = passcred != 0
- s.mu.Unlock()
+ s.ep.SocketOptions().SetPassCred(passcred != 0)
return nil
case linux.SO_ATTACH_FILTER: