diff options
author | Kevin Krakauer <krakauer@google.com> | 2020-01-21 13:16:25 -0800 |
---|---|---|
committer | Kevin Krakauer <krakauer@google.com> | 2020-01-21 13:16:25 -0800 |
commit | 62357a0afb5f4128a11dc9a1dfadd2957ec39e2d (patch) | |
tree | 2f93dc1bb5680434f3bcd69df60d45af89777a94 /pkg/sentry/socket/unix/unix.go | |
parent | bd292894097ffdf316bc78d81aebd0a2988124f3 (diff) | |
parent | 2ba6198851dc1e293295d7cadf8c0ae456b68beb (diff) |
Merge branch 'master' into iptables-write-filter-proto
Diffstat (limited to 'pkg/sentry/socket/unix/unix.go')
-rw-r--r-- | pkg/sentry/socket/unix/unix.go | 5 |
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) |