Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a06381fe authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds
Browse files

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.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Stable Team <stable@kernel.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b2510b16
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -409,14 +409,12 @@ static struct task_struct * futex_find_get_task(pid_t pid)

	rcu_read_lock();
	p = find_task_by_pid(pid);
	if (!p)
		goto out_unlock;
	if ((current->euid != p->euid) && (current->euid != p->uid)) {
		p = NULL;
		goto out_unlock;
	}

	if (!p || ((current->euid != p->euid) && (current->euid != p->uid)))
		p = ERR_PTR(-ESRCH);
	else
		get_task_struct(p);
out_unlock:

	rcu_read_unlock();

	return p;