diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-02-09 12:10:30 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-15 17:08:35 -0400 |
commit | a7c1938e22c02b008655524c766d185ae99d9d53 (patch) | |
tree | f6b862a5d187908007614e5537f4cd1e31a40df4 /arch/x86/ia32 | |
parent | 52137abe1820196d956bfd51edebc571b3427deb (diff) |
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>
Diffstat (limited to 'arch/x86/ia32')
-rw-r--r-- | arch/x86/ia32/sys_ia32.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index aec2202a596c..d5c820a54590 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
@@ -71,8 +71,8 @@ static int cp_stat64(struct stat64 __user *ubuf, struct kstat *stat) | |||
71 | { | 71 | { |
72 | typeof(ubuf->st_uid) uid = 0; | 72 | typeof(ubuf->st_uid) uid = 0; |
73 | typeof(ubuf->st_gid) gid = 0; | 73 | typeof(ubuf->st_gid) gid = 0; |
74 | SET_UID(uid, stat->uid); | 74 | SET_UID(uid, from_kuid_munged(current_user_ns(), stat->uid)); |
75 | SET_GID(gid, stat->gid); | 75 | SET_GID(gid, from_kgid_munged(current_user_ns(), stat->gid)); |
76 | if (!access_ok(VERIFY_WRITE, ubuf, sizeof(struct stat64)) || | 76 | if (!access_ok(VERIFY_WRITE, ubuf, sizeof(struct stat64)) || |
77 | __put_user(huge_encode_dev(stat->dev), &ubuf->st_dev) || | 77 | __put_user(huge_encode_dev(stat->dev), &ubuf->st_dev) || |
78 | __put_user(stat->ino, &ubuf->__st_ino) || | 78 | __put_user(stat->ino, &ubuf->__st_ino) || |