aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-02-07 21:36:10 -0500
committerEric W. Biederman <ebiederm@xmission.com>2012-05-15 17:59:25 -0400
commitebc887b278944fc478ab31a4be8ba0cae5fe4f48 (patch)
tree47dc4e0d9e876ade642ebe08fe8641075faab6ae /fs/binfmt_elf.c
parente1c972b681bf118fcedb9fe2ed7a73de983aa5ef (diff)
userns: Convert binary formats to use kuid/kgid where appropriate
Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 48ffb3dc610a..efc673163ef5 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -228,10 +228,10 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
228 NEW_AUX_ENT(AT_BASE, interp_load_addr); 228 NEW_AUX_ENT(AT_BASE, interp_load_addr);
229 NEW_AUX_ENT(AT_FLAGS, 0); 229 NEW_AUX_ENT(AT_FLAGS, 0);
230 NEW_AUX_ENT(AT_ENTRY, exec->e_entry); 230 NEW_AUX_ENT(AT_ENTRY, exec->e_entry);
231 NEW_AUX_ENT(AT_UID, cred->uid); 231 NEW_AUX_ENT(AT_UID, from_kuid_munged(cred->user_ns, cred->uid));
232 NEW_AUX_ENT(AT_EUID, cred->euid); 232 NEW_AUX_ENT(AT_EUID, from_kuid_munged(cred->user_ns, cred->euid));
233 NEW_AUX_ENT(AT_GID, cred->gid); 233 NEW_AUX_ENT(AT_GID, from_kgid_munged(cred->user_ns, cred->gid));
234 NEW_AUX_ENT(AT_EGID, cred->egid); 234 NEW_AUX_ENT(AT_EGID, from_kgid_munged(cred->user_ns, cred->egid));
235 NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm)); 235 NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm));
236 NEW_AUX_ENT(AT_RANDOM, (elf_addr_t)(unsigned long)u_rand_bytes); 236 NEW_AUX_ENT(AT_RANDOM, (elf_addr_t)(unsigned long)u_rand_bytes);
237 NEW_AUX_ENT(AT_EXECFN, bprm->exec); 237 NEW_AUX_ENT(AT_EXECFN, bprm->exec);
@@ -1367,8 +1367,8 @@ static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
1367 psinfo->pr_flag = p->flags; 1367 psinfo->pr_flag = p->flags;
1368 rcu_read_lock(); 1368 rcu_read_lock();
1369 cred = __task_cred(p); 1369 cred = __task_cred(p);
1370 SET_UID(psinfo->pr_uid, cred->uid); 1370 SET_UID(psinfo->pr_uid, from_kuid_munged(cred->user_ns, cred->uid));
1371 SET_GID(psinfo->pr_gid, cred->gid); 1371 SET_GID(psinfo->pr_gid, from_kgid_munged(cred->user_ns, cred->gid));
1372 rcu_read_unlock(); 1372 rcu_read_unlock();
1373 strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname)); 1373 strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname));
1374 1374