Commit 8e9a9197 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Greg Kroah-Hartman

FUTEX: Restore the dropped ERSCH fix

The return value of futex_find_get_task() needs to be -ESRCH in case
that the search fails. This was part of the original futex fixes and 
got accidentally dropped, when the futex-tidy-up patch was split out.

Results in a NULL pointer dereference in case the search fails.

Restore it.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cdd2bd2e
...@@ -390,14 +390,12 @@ static struct task_struct * futex_find_get_task(pid_t pid) ...@@ -390,14 +390,12 @@ static struct task_struct * futex_find_get_task(pid_t pid)
rcu_read_lock(); rcu_read_lock();
p = find_task_by_pid(pid); p = find_task_by_pid(pid);
if (!p)
goto out_unlock; if (!p || ((current->euid != p->euid) && (current->euid != p->uid)))
if ((current->euid != p->euid) && (current->euid != p->uid)) { p = ERR_PTR(-ESRCH);
p = NULL; else
goto out_unlock;
}
get_task_struct(p); get_task_struct(p);
out_unlock:
rcu_read_unlock(); rcu_read_unlock();
return p; return p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment