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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <163052451566.25758.7272209152781403112.tip-bot2@tip-bot2>
Date:   Wed, 01 Sep 2021 19:28:35 -0000
From:   "tip-bot2 for Colin Ian King" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Colin Ian King <colin.king@...onical.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        andrealmeid@...labora.com, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: locking/urgent] futex: Return error code instead of assigning
 it without effect

The following commit has been merged into the locking/urgent branch of tip:

Commit-ID:     1f15eb89144fdd4c881ef7181d51e989a732f4f0
Gitweb:        https://git.kernel.org/tip/1f15eb89144fdd4c881ef7181d51e989a732f4f0
Author:        Colin Ian King <colin.king@...onical.com>
AuthorDate:    Wed, 18 Aug 2021 14:18:40 +01:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Wed, 01 Sep 2021 21:26:33 +02:00

futex: Return error code instead of assigning it without effect

The check on the rt_waiter and top_waiter->pi_state is assigning an error
return code to ret but this later gets re-assigned, hence the check is
ineffective.

Return -EINVAL rather than assigning it to ret which was the original
intent.

Fixes: dc7109aaa233 ("futex: Validate waiter correctly in futex_proxy_trylock_atomic()")
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: André Almeida <andrealmeid@...labora.com>
Link: https://lore.kernel.org/r/20210818131840.34262-1-colin.king@canonical.com
---
 kernel/futex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index e7b4c61..30e7dae 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2025,7 +2025,7 @@ futex_proxy_trylock_atomic(u32 __user *pifutex, struct futex_hash_bucket *hb1,
 	 * and waiting on the 'waitqueue' futex which is always !PI.
 	 */
 	if (!top_waiter->rt_waiter || top_waiter->pi_state)
-		ret = -EINVAL;
+		return -EINVAL;
 
 	/* Ensure we requeue to the expected futex. */
 	if (!match_futex(top_waiter->requeue_pi_key, key2))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ