diff options
Diffstat (limited to 'fs/nfsd/nfs3xdr.c')
-rw-r--r-- | fs/nfsd/nfs3xdr.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 324c0baf7cda..925c944bc0bc 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c | |||
@@ -105,12 +105,14 @@ decode_sattr3(__be32 *p, struct iattr *iap) | |||
105 | iap->ia_mode = ntohl(*p++); | 105 | iap->ia_mode = ntohl(*p++); |
106 | } | 106 | } |
107 | if (*p++) { | 107 | if (*p++) { |
108 | iap->ia_valid |= ATTR_UID; | 108 | iap->ia_uid = make_kuid(&init_user_ns, ntohl(*p++)); |
109 | iap->ia_uid = ntohl(*p++); | 109 | if (uid_valid(iap->ia_uid)) |
110 | iap->ia_valid |= ATTR_UID; | ||
110 | } | 111 | } |
111 | if (*p++) { | 112 | if (*p++) { |
112 | iap->ia_valid |= ATTR_GID; | 113 | iap->ia_gid = make_kgid(&init_user_ns, ntohl(*p++)); |
113 | iap->ia_gid = ntohl(*p++); | 114 | if (gid_valid(iap->ia_gid)) |
115 | iap->ia_valid |= ATTR_GID; | ||
114 | } | 116 | } |
115 | if (*p++) { | 117 | if (*p++) { |
116 | u64 newsize; | 118 | u64 newsize; |
@@ -167,8 +169,8 @@ encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | |||
167 | *p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]); | 169 | *p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]); |
168 | *p++ = htonl((u32) stat->mode); | 170 | *p++ = htonl((u32) stat->mode); |
169 | *p++ = htonl((u32) stat->nlink); | 171 | *p++ = htonl((u32) stat->nlink); |
170 | *p++ = htonl((u32) nfsd_ruid(rqstp, stat->uid)); | 172 | *p++ = htonl((u32) from_kuid(&init_user_ns, stat->uid)); |
171 | *p++ = htonl((u32) nfsd_rgid(rqstp, stat->gid)); | 173 | *p++ = htonl((u32) from_kgid(&init_user_ns, stat->gid)); |
172 | if (S_ISLNK(stat->mode) && stat->size > NFS3_MAXPATHLEN) { | 174 | if (S_ISLNK(stat->mode) && stat->size > NFS3_MAXPATHLEN) { |
173 | p = xdr_encode_hyper(p, (u64) NFS3_MAXPATHLEN); | 175 | p = xdr_encode_hyper(p, (u64) NFS3_MAXPATHLEN); |
174 | } else { | 176 | } else { |