[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20191003173352.ai4wbllwo6lrxjju@yavin.dot.cyphar.com>
Date: Fri, 4 Oct 2019 03:33:52 +1000
From: Aleksa Sarai <cyphar@...har.com>
To: Christian Brauner <christian@...uner.io>
Cc: Nathan Chancellor <natechancellor@...il.com>,
Kees Cook <keescook@...omium.org>,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com
Subject: Re: [PATCH] usercopy: Add parentheses around assignment in
test_copy_struct_from_user
On 2019-10-03, Christian Brauner <christian@...uner.io> wrote:
> On Thu, Oct 3, 2019, 19:11 Nathan Chancellor <natechancellor@...il.com>
> wrote:
>
> > Clang warns:
> >
> > lib/test_user_copy.c:96:10: warning: using the result of an assignment
> > as a condition without parentheses [-Wparentheses]
> > if (ret |= test(umem_src == NULL, "kmalloc failed"))
> > ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > lib/test_user_copy.c:96:10: note: place parentheses around the
> > assignment to silence this warning
> > if (ret |= test(umem_src == NULL, "kmalloc failed"))
> > ^
> > ( )
> > lib/test_user_copy.c:96:10: note: use '!=' to turn this compound
> > assignment into an inequality comparison
> > if (ret |= test(umem_src == NULL, "kmalloc failed"))
> > ^~
> > !=
> >
> > 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 <natechancellor@...il.com>
> >
>
> I'll take this. Aleksa, can I get your ack too, please?
>
> Acked-by: Christian Brauner <christian.brauner@...ntu.com>
Acked-by: Aleksa Sarai <cyphar@...har.com>
--
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists