diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-07-21 15:45:02 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-07-21 15:45:08 -0400 |
commit | dca45ad8af54963c005393a484ad117b8ba6150f (patch) | |
tree | 7c9a6966283a6bb12b54e5680a67d203be292930 /kernel/futex.c | |
parent | 68c38fc3cb4e5a60f502ee9c45f3dfe70e5165ad (diff) | |
parent | cd5b8f8755a89a57fc8c408d284b8b613f090345 (diff) |
Merge branch 'linus' into sched/core
Merge reason: Move from the -rc3 to the almost-rc6 base.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index e7a35f1039e7..6a3a5fa1526d 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -429,20 +429,11 @@ static void free_pi_state(struct futex_pi_state *pi_state) | |||
429 | static struct task_struct * futex_find_get_task(pid_t pid) | 429 | static struct task_struct * futex_find_get_task(pid_t pid) |
430 | { | 430 | { |
431 | struct task_struct *p; | 431 | struct task_struct *p; |
432 | const struct cred *cred = current_cred(), *pcred; | ||
433 | 432 | ||
434 | rcu_read_lock(); | 433 | rcu_read_lock(); |
435 | p = find_task_by_vpid(pid); | 434 | p = find_task_by_vpid(pid); |
436 | if (!p) { | 435 | if (p) |
437 | p = ERR_PTR(-ESRCH); | 436 | get_task_struct(p); |
438 | } else { | ||
439 | pcred = __task_cred(p); | ||
440 | if (cred->euid != pcred->euid && | ||
441 | cred->euid != pcred->uid) | ||
442 | p = ERR_PTR(-ESRCH); | ||
443 | else | ||
444 | get_task_struct(p); | ||
445 | } | ||
446 | 437 | ||
447 | rcu_read_unlock(); | 438 | rcu_read_unlock(); |
448 | 439 | ||
@@ -564,8 +555,8 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, | |||
564 | if (!pid) | 555 | if (!pid) |
565 | return -ESRCH; | 556 | return -ESRCH; |
566 | p = futex_find_get_task(pid); | 557 | p = futex_find_get_task(pid); |
567 | if (IS_ERR(p)) | 558 | if (!p) |
568 | return PTR_ERR(p); | 559 | return -ESRCH; |
569 | 560 | ||
570 | /* | 561 | /* |
571 | * We need to look at the task state flags to figure out, | 562 | * We need to look at the task state flags to figure out, |