X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=kernel%2Ffutex_compat.c;h=d607a5b9ee29923617d462288e9853327c7d1527;hb=9ce04f9238cafcfd09a502f2bc8c13b5f44ec590;hp=3254d4e41e885bf37ce029ce95184f7ed4a7f59f;hpb=76aac0e9a17742e60d408be1a706e9aaad370891;p=safe%2Fjmp%2Flinux-2.6 diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c index 3254d4e..d607a5b 100644 --- a/kernel/futex_compat.c +++ b/kernel/futex_compat.c @@ -135,7 +135,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, { struct compat_robust_list_head __user *head; unsigned long ret; - uid_t euid = current_euid(); + const struct cred *cred = current_cred(), *pcred; if (!futex_cmpxchg_enabled) return -ENOSYS; @@ -151,8 +151,10 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, if (!p) goto err_unlock; ret = -EPERM; - if (euid != p->euid && euid != p->uid && - !capable(CAP_SYS_PTRACE)) + pcred = __task_cred(p); + if (cred->euid != pcred->euid && + cred->euid != pcred->uid && + !capable(CAP_SYS_PTRACE)) goto err_unlock; head = p->compat_robust_list; read_unlock(&tasklist_lock);