diff options
-rw-r--r-- | kernel/futex.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index df248f5e0836..45490bec5831 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -409,14 +409,12 @@ static struct task_struct * futex_find_get_task(pid_t pid) | |||
409 | 409 | ||
410 | rcu_read_lock(); | 410 | rcu_read_lock(); |
411 | p = find_task_by_pid(pid); | 411 | p = find_task_by_pid(pid); |
412 | if (!p) | 412 | |
413 | goto out_unlock; | 413 | if (!p || ((current->euid != p->euid) && (current->euid != p->uid))) |
414 | if ((current->euid != p->euid) && (current->euid != p->uid)) { | 414 | p = ERR_PTR(-ESRCH); |
415 | p = NULL; | 415 | else |
416 | goto out_unlock; | 416 | get_task_struct(p); |
417 | } | 417 | |
418 | get_task_struct(p); | ||
419 | out_unlock: | ||
420 | rcu_read_unlock(); | 418 | rcu_read_unlock(); |
421 | 419 | ||
422 | return p; | 420 | return p; |