diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-05-05 16:22:46 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-05-05 16:22:46 +0000 |
commit | 6097d1091481ded24605786697cf5943de8bc498 (patch) | |
tree | 17b66fb16e1245066b0240247c415eca31b672de /pkg/sentry/fs/gofer | |
parent | 935e4fbe42be1a7091545cb78dbd92c1d97f5871 (diff) | |
parent | 35951c3671f3d429399eb581ad9da3b56e2a5f5a (diff) |
Merge release-20200422.0-26-g35951c3 (automated)
Diffstat (limited to 'pkg/sentry/fs/gofer')
-rw-r--r-- | pkg/sentry/fs/gofer/attr.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/sentry/fs/gofer/attr.go b/pkg/sentry/fs/gofer/attr.go index 6db4b762d..d481baf77 100644 --- a/pkg/sentry/fs/gofer/attr.go +++ b/pkg/sentry/fs/gofer/attr.go @@ -75,10 +75,18 @@ func owner(mounter fs.FileOwner, valid p9.AttrMask, pattr p9.Attr) fs.FileOwner // task's EUID/EGID. owner := mounter if valid.UID { - owner.UID = auth.KUID(pattr.UID) + if pattr.UID.Ok() { + owner.UID = auth.KUID(pattr.UID) + } else { + owner.UID = auth.KUID(auth.OverflowUID) + } } if valid.GID { - owner.GID = auth.KGID(pattr.GID) + if pattr.GID.Ok() { + owner.GID = auth.KGID(pattr.GID) + } else { + owner.GID = auth.KGID(auth.OverflowGID) + } } return owner } |