Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3726075rwd; Mon, 29 May 2023 16:02:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6TFEThoaFdgloIBaQjjh/qeqrKAK8UaGS0OWitWFuoczlay3VFd+Gg0yCX7aQI3tSSoBPc X-Received: by 2002:a05:6a20:9389:b0:10f:1d52:93c2 with SMTP id x9-20020a056a20938900b0010f1d5293c2mr451318pzh.28.1685401352540; Mon, 29 May 2023 16:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685401352; cv=none; d=google.com; s=arc-20160816; b=bIVr7X3jw3a1Ynkwu7F+OwtA+pD+2kDaiLgk+KpdiwbLFjKvfdmIqAOrrl9OsAp56Q n6t22G2NeDc9kBkEuRE6jYje+iOt6+J7su6/ppvjsIq3t3tp2ZYbwHc+bKfVo9bDVKSo aeMS7fPk8gGvz6N3GS8aa5sxV7uCTo6s8Rz3JeDS1Y5Zsem77HzwUJE8KLOAX/9Gnvud Rte7Q5a8AbzDDNBgTb1SS4YakYjwOsWhp/Tou0fABYFjq5JKb4jTr1QaVC1GSWUqhNH1 XAJ62vD+3WWxdEOey4Aly860l+1S18ahmFbjUCIRyMewxCUc3mhH2wG2GLaLz/681LMN G5RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1LAlH2NU9fm2kbMS3sSlFfb7MPx4bChAyPnV1Ii59IE=; b=XaXEtfCHPYliPzkAZkxnngDPALvC/RrsFjC6GenftWesH4KbEKuzhdooDWtFhhU5Dx o/z/AyRVLlNIRb6+2nX7osJPGe66UHM950wtFfrZt43Q4anmTQ9yHc6liyq10WVIQPsj XG2t4i7J53nYNEQnRzHGwkGPjLctYODvqoQLzIGzOw7FbGPu4w1prD/fNO9S4g64f2qX HKM4AlGVnE/WKxNlCy2MRZJFiBHrDpCI980hfMe7QEM4A6BMkeBnGr35tgRdY5ViYRs0 HH4bqeTkcHudbtV0Nw3D1r73FsOskd2r2HlgeLpOhOvRxN/JjcxuFsGxts2Pu1m81jCO O7Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=aOy0BBZ+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i184-20020a636dc1000000b005306389636esi9920148pgc.689.2023.05.29.16.02.17; Mon, 29 May 2023 16:02:32 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=aOy0BBZ+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229461AbjE2Wyv (ORCPT + 99 others); Mon, 29 May 2023 18:54:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbjE2Wyq (ORCPT ); Mon, 29 May 2023 18:54:46 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB7ACA7; Mon, 29 May 2023 15:54:45 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-64d30ab1f89so2520752b3a.3; Mon, 29 May 2023 15:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685400885; x=1687992885; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1LAlH2NU9fm2kbMS3sSlFfb7MPx4bChAyPnV1Ii59IE=; b=aOy0BBZ+TBgy6dOkGhaBGVSj9YhSOy0BHIMbmnXZ55ISaaJP974hPPAk6P1Q4a78F2 +0d7EibN/BuAG8B2ohkggJRy0Nr23ctL9cbJQm2BOmWJvJjcszWkaFDPVkeeemJwdsbw SXM8cpPqPZsPzKY5lbJPT9eHxBl0eEBQij5VkLRbKviUNyED/ZZS6JYdinNfDn+HjnNc 7eoiPjXb38a8j2uT9x7YCuMLNEhlpvPqDu88cyNRJez3nJS49But0HS3s+DuSLYK9yAx fOArXQtSt2AVkUenQF3b1Pp28q6dNCCBqVRur/GZi1M0N0QGQso6zSvn++low4MhjTih D9tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685400885; x=1687992885; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1LAlH2NU9fm2kbMS3sSlFfb7MPx4bChAyPnV1Ii59IE=; b=VwXaAB4stH3B98Duo4c9w1fbzWe1MEb5ZVllKoP+DkZecfXZgp6zS703YrPvPGtqxn Ednob7a+1vDF4g8NXNYAgX3+sL/08P3JZNvSo2MhEC1wvgGw+LwObX1UsU4ZvEUL/+h7 OxBKdEHTdfXbjucgwOt+Uu4r2ijRM+euBt0rI5tEplVsVtwKIpxBacwV2dKI2PO7oMm3 fPEPwmdauM3dLif9Rv/JhK7p3YfUNxmYxQtn9RvW1u3RMtLkDN9gQW4GwNOUV1GUw4/F Fy+A0D4o5u2+j1BKknafYDiBnV1CqtTnHwcLaY7WQqkt69dcziO0xlJ4OI3y7CahJGfq 77XQ== X-Gm-Message-State: AC+VfDxHPFw6CYMPKlDcg03lzRb5lfTAutkWyNWmyjwnhrkkS/HHtVec TJKyW0bxVp68I27QvS8kZIs= X-Received: by 2002:a05:6a00:18a9:b0:64d:b0d8:a396 with SMTP id x41-20020a056a0018a900b0064db0d8a396mr206123pfh.7.1685400885103; Mon, 29 May 2023 15:54:45 -0700 (PDT) Received: from ubuntu777.domain.name (36-228-85-240.dynamic-ip.hinet.net. [36.228.85.240]) by smtp.gmail.com with ESMTPSA id c26-20020aa78e1a000000b0064d681c753csm445191pfr.40.2023.05.29.15.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 15:54:44 -0700 (PDT) From: Min-Hua Chen To: Serge Hallyn , Paul Moore , James Morris Cc: Min-Hua Chen , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] capabilities: use logical OR Date: Tue, 30 May 2023 06:54:39 +0800 Message-Id: <20230529225440.7315-1-minhuadotchen@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Use logical OR to fix the following sparse warnings: security/commoncap.c:1358:41: sparse: warning: dubious: !x | y No functional changes intended. 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