Commit c9876f75 authored by Mateusz Nosek's avatar Mateusz Nosek Committed by Yang Yingliang
Browse files

futex: Fix incorrect should_fail_futex() handling



stable inclusion
from linux-4.19.155
commit ae5aa5685c7cc1def1e07e0ab562087c5b8c78e7

--------------------------------

[ Upstream commit 921c7ebd ]

If should_futex_fail() returns true in futex_wake_pi(), then the 'ret'
variable is set to -EFAULT and then immediately overwritten. So the failure
injection is non-functional.

Fix it by actually leaving the function and returning -EFAULT.

The Fixes tag is kinda blury because the initial commit which introduced
failure injection was already sloppy, but the below mentioned commit broke
it completely.

[ tglx: Massaged changelog ]

Fixes: 6b4f4bc9 ("locking/futex: Allow low-level atomic operations to return -EAGAIN")
Signed-off-by: default avatarMateusz Nosek <mateusznosek0@gmail.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20200927000858.24219-1-mateusznosek0@gmail.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarCheng Jian <cj.chengjian@huawei.com>
parent a95d7996
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment