Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp837857pxb; Thu, 2 Sep 2021 16:48:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW+j7Pegs/OT7o0+icmNHV9hXhUIYBV/gNtox8GXA1PEkDK8IsyKshGoeqADvtTlXZHzGR X-Received: by 2002:aa7:d601:: with SMTP id c1mr880219edr.143.1630626512381; Thu, 02 Sep 2021 16:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630626512; cv=none; d=google.com; s=arc-20160816; b=GWtEMFEAuG2JiCjgnD3qoQDVM2b7WRPCUGwvpa9SCb/Ey2cPLdhzipM6F0LT7yV31l aMvR8tKeFC8XsJkTmmrh9C7cESPpdIo7ASHdk8NwIfRebZICh5bay3qy1AdvWZ/BVvhy jjBZG6+q5lniSnpfa6xFyuORPxkjVSL1P1KW4PVWX8u7SlvYQg+xJk92/Xy0/k3nFJIV P/TFPcuk2Y998s/IEV1eMfHGbMzSAOgJXO+oBl1y88WcfsgX4Dw7rLpzwvcCPgvHTLwV TZ9Xcch1UIdD2yMojpG+AtrK78ymKnI6bXXyv95JuJvVSQl0yKKRI5/iMTVe/k2glWhU qEyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=9I8OlriWSRjNHUXRiqNwrgJsUjSPy3bhZS7GrgiHUgE=; b=mG9ejIBxEuzdS9gwB2lTWIf0e2sZPxqOUaJK7fC5M/0BHNGHfP2X354M0+3BcX9R3A A7Vs7DvWo8VAlUT4n14Az1232RwUm66vsDXbD4D5EZnYfiepNNIrdFpjduUHTJiuJA3w jQ3HvPcY/sjBIMlh1FyeonQckhLdaImaZU+CpVfXX4XQ6bEX56GD/XFRwkQa4P+3CMiL hTcA/OiDF/NfCjKoARSvD1RQI7bGAl34QjbpuULZHaWm7emkN72D/gKjSDC+50yvRBUG JtAybWHMzQ4tSTNS3QA1HP5WbBzLUG9lrC9KZUazXES3Xs5LIeZJQlyxtzdRk1n1Nno+ ipWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UtpGUech; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb10si991833ejc.412.2021.09.02.16.48.09; Thu, 02 Sep 2021 16:48:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UtpGUech; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345785AbhIBUPq (ORCPT + 99 others); Thu, 2 Sep 2021 16:15:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345418AbhIBUPc (ORCPT ); Thu, 2 Sep 2021 16:15:32 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57D89C061575; Thu, 2 Sep 2021 13:14:33 -0700 (PDT) Date: Thu, 02 Sep 2021 20:14:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1630613671; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9I8OlriWSRjNHUXRiqNwrgJsUjSPy3bhZS7GrgiHUgE=; b=UtpGUechQGiFRtEq3SAQSqir6YMnHMYfzpXAD6C4jvlth/qmXT/5TPYGv2V7q1MTC5YRR3 j75rgCswR5oquFcKKSXg/aEe5RYNxfbxym/k4Uq+bFpVMbglJLBSfzVf2QPqHnvAxZam1g 2JGiDov/DsFWs2aG4qgnnMdiS1pnQaygse9tpi0gsmEHnQtdYNWbOJU4P7cP0exWSClwi9 tb6uyAp1R8mdD2togCbxRD0ppohKEezXTcA0+b4jHsUJGvzTP0uAAaIV3ypzaUtntJC7yU H8q7qzQ9lLwnBpSEzQiRCccUDoAT8YBBi2+Rh2Fq0AYFGF2Ecfxfjr0qYTJy2w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1630613671; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9I8OlriWSRjNHUXRiqNwrgJsUjSPy3bhZS7GrgiHUgE=; b=BA8udAARbqDBZ7JJHK8hwbRnrMPZuelttSZPBjGgAVt4/mulciOszMAP4G8oYrw52fFIUS Qod8z3kzL3XFpGBQ== From: "tip-bot2 for Colin Ian King" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/urgent] futex: Return error code instead of assigning it without effect Cc: Colin Ian King , Thomas Gleixner , andrealmeid@collabora.com, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210818131840.34262-1-colin.king@canonical.com> References: <20210818131840.34262-1-colin.king@canonical.com> MIME-Version: 1.0 Message-ID: <163061367113.25758.10441165083274844287.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/urgent branch of tip: Commit-ID: a974b54036f79dd5e395e9f6c80c3decb4661a14 Gitweb: https://git.kernel.org/tip/a974b54036f79dd5e395e9f6c80c3decb46= 61a14 Author: Colin Ian King AuthorDate: Wed, 18 Aug 2021 14:18:40 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 02 Sep 2021 22:07:18 +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 Signed-off-by: Thomas Gleixner Reviewed-by: Andr=C3=A9 Almeida Link: https://lore.kernel.org/r/20210818131840.34262-1-colin.king@canonical.c= om --- 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 =3D -EINVAL; + return -EINVAL; =20 /* Ensure we requeue to the expected futex. */ if (!match_futex(top_waiter->requeue_pi_key, key2))