Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4581620rwd; Tue, 30 May 2023 07:19:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ708YII/7Hf+/TBFTff1qzs5n0TE7AKt60IfF9d2+que4YZt1mS1ZSvWl+4THV1DzS5ayz9 X-Received: by 2002:a05:6a00:1594:b0:64f:daa6:3e3f with SMTP id u20-20020a056a00159400b0064fdaa63e3fmr3529327pfk.5.1685456376740; Tue, 30 May 2023 07:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685456376; cv=none; d=google.com; s=arc-20160816; b=YZe5ii5MBWcR6/IIXmKX1Cq9Ts37zAdJiKMQqXmKJY7JFrg/KrU8VSAeN9JYqNnlXx K1XLsRlbB6cfQQTITaM3bnEcufubmUMF/mlRF4owLV6237XYy/j6Hih5YY5L++rXe0+3 WNqhpKI/2beFuVjFpdlRIVxf6AwAFrYuC9DNq1eG1wIcUayr2gXw/ibigt9kPi539F4f ktG7pyl+lY2TfKv98XVs8tl9TzIPXFvemvkGMLPp9SejR++Lx2sju1zJjQ0CKypMg43n poE2oDsRu9cryYXHvRGgfEHhLNs4tr0wOIJAtz+1bJslp1BZePlH/P3kiWuY7lAk50hS yN4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=eE4kgysxG7dI5Xd5rBKbN1ldZREXmzcS9zIjX49GvU8=; b=UK8kj2ysXIn6s1/3eQsEc7amn/ku/gugl7Hy42YrHDUqvvCalKLM8dgRNW65hBgWsq 935mbJnEn9eSJSqqb5pvHJ1CSyu1s+IFex+9rvEwKmDagtKTYFsMIs9JJIh79QleVvDs RL/sjpGazVRNE8bSANSu3J8IDdlInfaFFbQ5mJ1KN8ygC2CWyOXuFQv5lXJpAUZJc0h3 RLlPgn/MrBa3GKiSfTBXCALnQLUdLiKB4CMAez8kn9FTpO1ev8fadv+RvBhm7dttH+Yq nngqMSpCEa8IEsZ9JqJYOnoMunG7De6vYEDAQVc7SlkL8FDMf1DcKXYbnDbY64AgeZ/W 7RJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r1-20020aa79621000000b0064d2e108cecsi228456pfg.104.2023.05.30.07.19.21; Tue, 30 May 2023 07:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232889AbjE3OF7 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 30 May 2023 10:05:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232891AbjE3OF4 (ORCPT ); Tue, 30 May 2023 10:05:56 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8405F7 for ; Tue, 30 May 2023 07:05:54 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-106-Am8f-XMVN6K4UDEwCA02rg-1; Tue, 30 May 2023 15:05:51 +0100 X-MC-Unique: Am8f-XMVN6K4UDEwCA02rg-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 30 May 2023 15:05:48 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Tue, 30 May 2023 15:05:48 +0100 From: David Laight To: 'Min-Hua Chen' , Serge Hallyn , Paul Moore , James Morris CC: "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] capabilities: use logical OR Thread-Topic: [PATCH] capabilities: use logical OR Thread-Index: AQHZkoCZLKnbYMsJn0ez1CCVI83RJq9y2m1A Date: Tue, 30 May 2023 14:05:48 +0000 Message-ID: References: <20230529225440.7315-1-minhuadotchen@gmail.com> In-Reply-To: <20230529225440.7315-1-minhuadotchen@gmail.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Min-Hua Chen > 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 > --- > 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)