summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/socket/unix
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-01-13 22:59:54 +0000
committergVisor bot <gvisor-bot@google.com>2020-01-13 22:59:54 +0000
commitb85d0668bb4c8f99434e7d9d1ff513c7b993c4c2 (patch)
treedc769fa04b1c69be15dd92d78f3abc18374baf52 /pkg/sentry/socket/unix
parent04150ecaae2fd147b79e96a2b99c7cd4d5fa376f (diff)
parentdebd213da61cf35d7c91346820e93fc87bfa5896 (diff)
Merge release-20191213.0-113-gdebd213 (automated)
Diffstat (limited to 'pkg/sentry/socket/unix')
-rw-r--r--pkg/sentry/socket/unix/unix.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/sentry/socket/unix/unix.go b/pkg/sentry/socket/unix/unix.go
index 91effe89a..7f49ba864 100644
--- a/pkg/sentry/socket/unix/unix.go
+++ b/pkg/sentry/socket/unix/unix.go
@@ -116,13 +116,16 @@ func (s *SocketOperations) Endpoint() transport.Endpoint {
// extractPath extracts and validates the address.
func extractPath(sockaddr []byte) (string, *syserr.Error) {
- addr, _, err := netstack.AddressAndFamily(linux.AF_UNIX, sockaddr, true /* strict */)
+ addr, family, err := netstack.AddressAndFamily(sockaddr)
if err != nil {
if err == syserr.ErrAddressFamilyNotSupported {
err = syserr.ErrInvalidArgument
}
return "", err
}
+ if family != linux.AF_UNIX {
+ return "", syserr.ErrInvalidArgument
+ }
// The address is trimmed by GetAddress.
p := string(addr.Addr)