userns: Convert stat to return values mapped from kuids and kgids
- Store uids and gids with kuid_t and kgid_t in struct kstat - Convert uid and gids to userspace usable values with from_kuid and from_kgid Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
This commit is contained in:
@@ -144,8 +144,8 @@ static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
|
||||
tmp.st_nlink = stat->nlink;
|
||||
if (tmp.st_nlink != stat->nlink)
|
||||
return -EOVERFLOW;
|
||||
SET_UID(tmp.st_uid, stat->uid);
|
||||
SET_GID(tmp.st_gid, stat->gid);
|
||||
SET_UID(tmp.st_uid, from_kuid_munged(current_user_ns(), stat->uid));
|
||||
SET_GID(tmp.st_gid, from_kgid_munged(current_user_ns(), stat->gid));
|
||||
tmp.st_rdev = old_encode_dev(stat->rdev);
|
||||
if ((u64) stat->size > MAX_NON_LFS)
|
||||
return -EOVERFLOW;
|
||||
|
Reference in New Issue
Block a user