Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp132111ybp; Thu, 3 Oct 2019 11:13:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGViYVV0lUR797k59BRtoXVDGlrQQuvaIT4zKevv1Ex0Ox0W+tlEmNdelxbORtEO+SDGVz X-Received: by 2002:a17:906:bcd9:: with SMTP id lw25mr1283980ejb.315.1570126392379; Thu, 03 Oct 2019 11:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570126392; cv=none; d=google.com; s=arc-20160816; b=0lG0etzChow9TB5CPJyNP4s2d0+5XKuYxNL2OCK39MAGIC+vc8YpUnREOrynWlUsqh iR9glC6iN3J8lrkGnbK4zvyEVhgdmeivHQxnwkftzyg/TT61sw8Httnk1eFYI5sp7hKK YR5cvsLN+74ty9lfPT8je1jyrwON7L1lId8yNyFqLLiXMWX1VsTJg2I91Jot3qV7013j /ljVhcWmF1YGJcVZ73+Eyb2Iyd8TErd+VZ0DtPwDee1qxtrxowUy7y+7yiVWbJ0157Ey Ng0GczWh7kPWgnHSs0KPAYKqgsqwH12RSF7Ly+lIwzYj8GwHz0CkF8f2OQu14MHYgXSX KQPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mCn63yFEsv7kA9RQLiAWpWH8PsMGr2gJGuKj3CUJ9t8=; b=PXfl384837vcieKCTp7VnyvZx7DC//JU+JNQ4kE+9ELUdapeSGPGGfxHDs27vIGoil INdHgiIbeBJLl1QohadLE7wpv+6cXJryQ/AKTNuEjwH3QsDwbNT0HcPWhu8ir0X3lUFR yrYX141ooTNSkU8i07pgnpEUE6zgHC5M0YNyTB+2llRcg5KHVWY+vlGrVM3djnixkh1r yluFWWjKfqWwpo8kQW2Z+oIpYQo4WK36s9YnGZDW3A9NlVcP9/x1YzEKIk9mxaqZPDsV Em5Mn0f5aCycZuNjkdL1fhhK217Y7ntv6fsGRgxzdM44grg+M5uXV78L76MMA44Wh3NP Gv8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si1873702edv.66.2019.10.03.11.12.47; Thu, 03 Oct 2019 11:13:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733084AbfJCReH (ORCPT + 99 others); Thu, 3 Oct 2019 13:34:07 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:35092 "EHLO mx2.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732907AbfJCReF (ORCPT ); Thu, 3 Oct 2019 13:34:05 -0400 Received: from smtp2.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 0E95AA1BF4; Thu, 3 Oct 2019 19:34:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id ZVLOBka5CkYJ; Thu, 3 Oct 2019 19:34:00 +0200 (CEST) Date: Fri, 4 Oct 2019 03:33:52 +1000 From: Aleksa Sarai To: Christian Brauner Cc: Nathan Chancellor , Kees Cook , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] usercopy: Add parentheses around assignment in test_copy_struct_from_user Message-ID: <20191003173352.ai4wbllwo6lrxjju@yavin.dot.cyphar.com> References: <20191003171121.2723619-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mq3doqufbzkhsyhl" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mq3doqufbzkhsyhl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-10-03, Christian Brauner wrote: > On Thu, Oct 3, 2019, 19:11 Nathan Chancellor > wrote: >=20 > > Clang warns: > > > > lib/test_user_copy.c:96:10: warning: using the result of an assignment > > as a condition without parentheses [-Wparentheses] > > if (ret |=3D test(umem_src =3D=3D NULL, "kmalloc failed")) > > ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > lib/test_user_copy.c:96:10: note: place parentheses around the > > assignment to silence this warning > > if (ret |=3D test(umem_src =3D=3D NULL, "kmalloc failed")) > > ^ > > ( ) > > lib/test_user_copy.c:96:10: note: use '!=3D' to turn this compound > > assignment into an inequality comparison > > if (ret |=3D test(umem_src =3D=3D NULL, "kmalloc failed")) > > ^~ > > !=3D > > > > Add the parentheses as it suggests because this is intentional. > > > > Fixes: f5a1a536fa14 ("lib: introduce copy_struct_from_user() helper") > > Link: https://github.com/ClangBuiltLinux/linux/issues/731 > > Signed-off-by: Nathan Chancellor > > >=20 > I'll take this. Aleksa, can I get your ack too, please? >=20 > Acked-by: Christian Brauner Acked-by: Aleksa Sarai --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --mq3doqufbzkhsyhl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSxZm6dtfE8gxLLfYqdlLljIbnQEgUCXZYw/QAKCRCdlLljIbnQ ErZYAP4heG3krz9cEVZdwR0992zolXZYYA3cb+gwBXtyntW4tQEA7oYTckHSxzrw 2x9+2UkmgGKl+HPHYP3tiwp6I40UOQg= =IFPY -----END PGP SIGNATURE----- --mq3doqufbzkhsyhl--