lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200927000858.24219-1-mateusznosek0@gmail.com>
Date:   Sun, 27 Sep 2020 02:08:58 +0200
From:   mateusznosek0@...il.com
To:     linux-kernel@...r.kernel.org
Cc:     Mateusz Nosek <mateusznosek0@...il.com>, tglx@...utronix.de,
        mingo@...hat.com
Subject: [PATCH] kernel/futex.c: fix incorrect 'should_fail_futex' handling

From: Mateusz Nosek <mateusznosek0@...il.com>

Previously if 'futex_should_fail' returned true, then only 'ret' variable
was set, which was later overwritten without being read. The patch fixes
the problem.

Signed-off-by: Mateusz Nosek <mateusznosek0@...il.com>
---
 kernel/futex.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index a5876694a60e..39681bf8b06c 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1502,8 +1502,10 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_
 	 */
 	newval = FUTEX_WAITERS | task_pid_vnr(new_owner);
 
-	if (unlikely(should_fail_futex(true)))
+	if (unlikely(should_fail_futex(true))) {
 		ret = -EFAULT;
+		goto out_unlock;
+	}
 
 	ret = cmpxchg_futex_value_locked(&curval, uaddr, uval, newval);
 	if (!ret && (curval != uval)) {
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ