[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <db536b16e33648fdb44629fc9c1c1afc@AcuMS.aculab.com>
Date: Tue, 30 May 2023 14:05:48 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Min-Hua Chen' <minhuadotchen@...il.com>,
Serge Hallyn <serge@...lyn.com>,
Paul Moore <paul@...l-moore.com>,
James Morris <jmorris@...ei.org>
CC: "linux-security-module@...r.kernel.org"
<linux-security-module@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] capabilities: use logical OR
From: Min-Hua Chen <minhuadotchen@...il.com>
> Sent: 29 May 2023 23:55
>
> Use logical OR to fix the following sparse warnings:
>
> security/commoncap.c:1358:41: sparse: warning: dubious: !x | y
>
> No functional changes intended.
Except it will run just that teeny, weeny bit slower.
David
> Signed-off-by: Min-Hua Chen <minhuadotchen@...il.com>
> ---
> security/commoncap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/commoncap.c b/security/commoncap.c
> index 0b3fc2f3afe7..b8e34f6204b2 100644
> --- a/security/commoncap.c
> +++ b/security/commoncap.c
> @@ -1355,7 +1355,7 @@ int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
> return commit_creds(new);
> }
>
> - if (((!cap_valid(arg3)) | arg4 | arg5))
> + if (((!cap_valid(arg3)) || arg4 || arg5))
> return -EINVAL;
>
> if (arg2 == PR_CAP_AMBIENT_IS_SET) {
> --
> 2.34.1
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists