diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-08-07 07:02:41 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-21 06:13:29 -0400 |
commit | 6c1ee033591ada69805a4a10108f28bbc0d67281 (patch) | |
tree | 35dc3fbcd599c9393a58e67b8bd3dc444651e259 /arch/ia64/kernel | |
parent | 9e184e0aa386099c8a78f4f04f882a57ac11d8fc (diff) |
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: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/mca_drv.c | 3 | ||||
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 32 | ||||
-rw-r--r-- | arch/ia64/kernel/signal.c | 4 |
3 files changed, 20 insertions, 19 deletions
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c index 1c2e89406721..9392e021c93b 100644 --- a/arch/ia64/kernel/mca_drv.c +++ b/arch/ia64/kernel/mca_drv.c | |||
@@ -158,7 +158,8 @@ mca_handler_bh(unsigned long paddr, void *iip, unsigned long ipsr) | |||
158 | ia64_mlogbuf_dump(); | 158 | ia64_mlogbuf_dump(); |
159 | printk(KERN_ERR "OS_MCA: process [cpu %d, pid: %d, uid: %d, " | 159 | printk(KERN_ERR "OS_MCA: process [cpu %d, pid: %d, uid: %d, " |
160 | "iip: %p, psr: 0x%lx,paddr: 0x%lx](%s) encounters MCA.\n", | 160 | "iip: %p, psr: 0x%lx,paddr: 0x%lx](%s) encounters MCA.\n", |
161 | raw_smp_processor_id(), current->pid, current_uid(), | 161 | raw_smp_processor_id(), current->pid, |
162 | from_kuid(&init_user_ns, current_uid()), | ||
162 | iip, ipsr, paddr, current->comm); | 163 | iip, ipsr, paddr, current->comm); |
163 | 164 | ||
164 | spin_lock(&mca_bh_lock); | 165 | spin_lock(&mca_bh_lock); |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 3fa4bc536953..5a5c22245dee 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -2380,8 +2380,8 @@ static int | |||
2380 | pfm_bad_permissions(struct task_struct *task) | 2380 | pfm_bad_permissions(struct task_struct *task) |
2381 | { | 2381 | { |
2382 | const struct cred *tcred; | 2382 | const struct cred *tcred; |
2383 | uid_t uid = current_uid(); | 2383 | kuid_t uid = current_uid(); |
2384 | gid_t gid = current_gid(); | 2384 | kgid_t gid = current_gid(); |
2385 | int ret; | 2385 | int ret; |
2386 | 2386 | ||
2387 | rcu_read_lock(); | 2387 | rcu_read_lock(); |
@@ -2389,20 +2389,20 @@ pfm_bad_permissions(struct task_struct *task) | |||
2389 | 2389 | ||
2390 | /* inspired by ptrace_attach() */ | 2390 | /* inspired by ptrace_attach() */ |
2391 | DPRINT(("cur: uid=%d gid=%d task: euid=%d suid=%d uid=%d egid=%d sgid=%d\n", | 2391 | DPRINT(("cur: uid=%d gid=%d task: euid=%d suid=%d uid=%d egid=%d sgid=%d\n", |
2392 | uid, | 2392 | from_kuid(&init_user_ns, uid), |
2393 | gid, | 2393 | from_kgid(&init_user_ns, gid), |
2394 | tcred->euid, | 2394 | from_kuid(&init_user_ns, tcred->euid), |
2395 | tcred->suid, | 2395 | from_kuid(&init_user_ns, tcred->suid), |
2396 | tcred->uid, | 2396 | from_kuid(&init_user_ns, tcred->uid), |
2397 | tcred->egid, | 2397 | from_kgid(&init_user_ns, tcred->egid), |
2398 | tcred->sgid)); | 2398 | from_kgid(&init_user_ns, tcred->sgid))); |
2399 | 2399 | ||
2400 | ret = ((uid != tcred->euid) | 2400 | ret = ((!uid_eq(uid, tcred->euid)) |
2401 | || (uid != tcred->suid) | 2401 | || (!uid_eq(uid, tcred->suid)) |
2402 | || (uid != tcred->uid) | 2402 | || (!uid_eq(uid, tcred->uid)) |
2403 | || (gid != tcred->egid) | 2403 | || (!gid_eq(gid, tcred->egid)) |
2404 | || (gid != tcred->sgid) | 2404 | || (!gid_eq(gid, tcred->sgid)) |
2405 | || (gid != tcred->gid)) && !capable(CAP_SYS_PTRACE); | 2405 | || (!gid_eq(gid, tcred->gid))) && !capable(CAP_SYS_PTRACE); |
2406 | 2406 | ||
2407 | rcu_read_unlock(); | 2407 | rcu_read_unlock(); |
2408 | return ret; | 2408 | return ret; |
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index a199be1fe619..37dd79511cbe 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c | |||
@@ -220,7 +220,7 @@ ia64_rt_sigreturn (struct sigscratch *scr) | |||
220 | si.si_errno = 0; | 220 | si.si_errno = 0; |
221 | si.si_code = SI_KERNEL; | 221 | si.si_code = SI_KERNEL; |
222 | si.si_pid = task_pid_vnr(current); | 222 | si.si_pid = task_pid_vnr(current); |
223 | si.si_uid = current_uid(); | 223 | si.si_uid = from_kuid_munged(current_user_ns(), current_uid()); |
224 | si.si_addr = sc; | 224 | si.si_addr = sc; |
225 | force_sig_info(SIGSEGV, &si, current); | 225 | force_sig_info(SIGSEGV, &si, current); |
226 | return retval; | 226 | return retval; |
@@ -317,7 +317,7 @@ force_sigsegv_info (int sig, void __user *addr) | |||
317 | si.si_errno = 0; | 317 | si.si_errno = 0; |
318 | si.si_code = SI_KERNEL; | 318 | si.si_code = SI_KERNEL; |
319 | si.si_pid = task_pid_vnr(current); | 319 | si.si_pid = task_pid_vnr(current); |
320 | si.si_uid = current_uid(); | 320 | si.si_uid = from_kuid_munged(current_user_ns(), current_uid()); |
321 | si.si_addr = addr; | 321 | si.si_addr = addr; |
322 | force_sig_info(SIGSEGV, &si, current); | 322 | force_sig_info(SIGSEGV, &si, current); |
323 | return 0; | 323 | return 0; |