diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-12-04 17:33:32 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-12-04 17:33:32 +1100 |
commit | b894d099e1cc413305d5a1649816701ec291538d (patch) | |
tree | 570196112e04fa091b87be4ba0b84fcb250de53f /kernel/futex_compat.c | |
parent | fc2985800d164066d9fd4ab2334bea6380d4472d (diff) | |
parent | 3496f92beb9aa99ef21fccc154a36c7698e9c538 (diff) |
Merge commit 'security-testing/next'
Conflicts:
fs/cifs/cifs_fs_sb.h
fs/nfsd/nfs4recover.c
fs/ocfs2/namei.c
Diffstat (limited to 'kernel/futex_compat.c')
-rw-r--r-- | kernel/futex_compat.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c index 04ac3a9e42cf..d607a5b9ee29 100644 --- a/kernel/futex_compat.c +++ b/kernel/futex_compat.c @@ -135,6 +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; + const struct cred *cred = current_cred(), *pcred; if (!futex_cmpxchg_enabled) return -ENOSYS; @@ -150,8 +151,10 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, if (!p) goto err_unlock; ret = -EPERM; - if ((current->euid != p->euid) && (current->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); |