Commit 6c1ee033 authored by Eric W. Biederman's avatar Eric W. Biederman

userns: On ia64 deal with current_uid and current_gid being kuid and kgid

These ia64 uses of current_uid and current_gid slipped through the
cracks when I was converting everything to kuids and kgids convert
them now.

Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 9e184e0a
...@@ -158,7 +158,8 @@ mca_handler_bh(unsigned long paddr, void *iip, unsigned long ipsr) ...@@ -158,7 +158,8 @@ mca_handler_bh(unsigned long paddr, void *iip, unsigned long ipsr)
ia64_mlogbuf_dump(); ia64_mlogbuf_dump();
printk(KERN_ERR "OS_MCA: process [cpu %d, pid: %d, uid: %d, " printk(KERN_ERR "OS_MCA: process [cpu %d, pid: %d, uid: %d, "
"iip: %p, psr: 0x%lx,paddr: 0x%lx](%s) encounters MCA.\n", "iip: %p, psr: 0x%lx,paddr: 0x%lx](%s) encounters MCA.\n",
raw_smp_processor_id(), current->pid, current_uid(), raw_smp_processor_id(), current->pid,
from_kuid(&init_user_ns, current_uid()),
iip, ipsr, paddr, current->comm); iip, ipsr, paddr, current->comm);
spin_lock(&mca_bh_lock); spin_lock(&mca_bh_lock);
......
...@@ -2380,8 +2380,8 @@ static int ...@@ -2380,8 +2380,8 @@ static int
pfm_bad_permissions(struct task_struct *task) pfm_bad_permissions(struct task_struct *task)
{ {
const struct cred *tcred; const struct cred *tcred;
uid_t uid = current_uid(); kuid_t uid = current_uid();
gid_t gid = current_gid(); kgid_t gid = current_gid();
int ret; int ret;
rcu_read_lock(); rcu_read_lock();
...@@ -2389,20 +2389,20 @@ pfm_bad_permissions(struct task_struct *task) ...@@ -2389,20 +2389,20 @@ pfm_bad_permissions(struct task_struct *task)
/* inspired by ptrace_attach() */ /* inspired by ptrace_attach() */
DPRINT(("cur: uid=%d gid=%d task: euid=%d suid=%d uid=%d egid=%d sgid=%d\n", DPRINT(("cur: uid=%d gid=%d task: euid=%d suid=%d uid=%d egid=%d sgid=%d\n",
uid, from_kuid(&init_user_ns, uid),
gid, from_kgid(&init_user_ns, gid),
tcred->euid, from_kuid(&init_user_ns, tcred->euid),
tcred->suid, from_kuid(&init_user_ns, tcred->suid),
tcred->uid, from_kuid(&init_user_ns, tcred->uid),
tcred->egid, from_kgid(&init_user_ns, tcred->egid),
tcred->sgid)); from_kgid(&init_user_ns, tcred->sgid)));
ret = ((uid != tcred->euid) ret = ((!uid_eq(uid, tcred->euid))
|| (uid != tcred->suid) || (!uid_eq(uid, tcred->suid))
|| (uid != tcred->uid) || (!uid_eq(uid, tcred->uid))
|| (gid != tcred->egid) || (!gid_eq(gid, tcred->egid))
|| (gid != tcred->sgid) || (!gid_eq(gid, tcred->sgid))
|| (gid != tcred->gid)) && !capable(CAP_SYS_PTRACE); || (!gid_eq(gid, tcred->gid))) && !capable(CAP_SYS_PTRACE);
rcu_read_unlock(); rcu_read_unlock();
return ret; return ret;
......
...@@ -220,7 +220,7 @@ ia64_rt_sigreturn (struct sigscratch *scr) ...@@ -220,7 +220,7 @@ ia64_rt_sigreturn (struct sigscratch *scr)
si.si_errno = 0; si.si_errno = 0;
si.si_code = SI_KERNEL; si.si_code = SI_KERNEL;
si.si_pid = task_pid_vnr(current); si.si_pid = task_pid_vnr(current);
si.si_uid = current_uid(); si.si_uid = from_kuid_munged(current_user_ns(), current_uid());
si.si_addr = sc; si.si_addr = sc;
force_sig_info(SIGSEGV, &si, current); force_sig_info(SIGSEGV, &si, current);
return retval; return retval;
...@@ -317,7 +317,7 @@ force_sigsegv_info (int sig, void __user *addr) ...@@ -317,7 +317,7 @@ force_sigsegv_info (int sig, void __user *addr)
si.si_errno = 0; si.si_errno = 0;
si.si_code = SI_KERNEL; si.si_code = SI_KERNEL;
si.si_pid = task_pid_vnr(current); si.si_pid = task_pid_vnr(current);
si.si_uid = current_uid(); si.si_uid = from_kuid_munged(current_user_ns(), current_uid());
si.si_addr = addr; si.si_addr = addr;
force_sig_info(SIGSEGV, &si, current); force_sig_info(SIGSEGV, &si, current);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment