Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp585094iob; Wed, 4 May 2022 03:48:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpfCC1u+aOIj1hm1f4m6VUecTmlDmrpG8y/bZtqy/2QZ0NNdB//EZKGJ0PY9k4JaiM4oI5 X-Received: by 2002:a17:906:478b:b0:6db:8b6e:d5de with SMTP id cw11-20020a170906478b00b006db8b6ed5demr20155505ejc.161.1651661291778; Wed, 04 May 2022 03:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651661291; cv=none; d=google.com; s=arc-20160816; b=sLYjlmffq9HHoQynF50I7Ni1ryv+eCTthkxJJ8P6Y/HkHAAWp5Jf6rK060bvL28kyY Lx3LqYLxLXMKCFeHHx25pT2UaV0lxZRFu8CzRHjexMFKJwP6QCKrRI7DPEfsxOuQn9jF 5V+uM4TIp/5dP1uNEiMTeJ8TN3fXW3HCtQmyt2p9ChAVwXlcr7/ZMIuHQ76eL4R12D4q S0vnVJVuWiBFVPANx4HptSKfqlgSFKpVMQQ0/Lso4P7h2C2zhmBfE55pTMIBgPdMNZCd 971ReRWczei6LGMXTy9JaTcyGRBiul/IviGC31mUk/4Y0XSD8kHx2DE0SNJlrbn+N+v7 fxFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=h+anUim6N8kPhedaRXqtOLw9+/rgUrHm7QzUFJPNxuM=; b=0MexRf8awgyAFfMJJxcBKbZVyEpGXExKGjUoCK0C2Mrxv7m5KN4UqxqDNXuz4fswmU 6jkN3T1WLidYlpRk+7KN/QCwl5l9GEObLGWXC4CFDNLqXzew9vrMj5TvAl7UDBu6M2Xy s3vZbhHw44BCRL4ND4gYB0zIfrYzMRZ19vtCCfPQEWpR6KKqJM+UO6II88YNcdwnUAtq zfZK3TzyM++sBL6hZi43jQGvvL+UJSrhYOXN0lXJ9DdoBNnK3qvA65eHcysld/EN96Fv wp57Ry0z1mVY9wSMOID0Q3kfpboOo+pDnSTZViiCm7UHgBHJLM2mvPsDuXwUKDpldWOz tozA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=2hWm19ck; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds14-20020a170907724e00b006f4489b45bdsi7576067ejc.697.2022.05.04.03.47.46; Wed, 04 May 2022 03:48:11 -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=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=2hWm19ck; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235667AbiECUVt (ORCPT + 99 others); Tue, 3 May 2022 16:21:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233749AbiECUVr (ORCPT ); Tue, 3 May 2022 16:21:47 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A5CA2BB15 for ; Tue, 3 May 2022 13:18:13 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id z5-20020a17090a468500b001d2bc2743c4so2965462pjf.0 for ; Tue, 03 May 2022 13:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=h+anUim6N8kPhedaRXqtOLw9+/rgUrHm7QzUFJPNxuM=; b=2hWm19ckEKWfsMbIjsekIVatx68j91DvHaRPoS0oToKiAtQkyaNB09ti8snB7nohNF Rces+wM3fsi8aNPXfMa3adr9mWjqtwcYDefEp6weeIn8ldSfAw481Nv1cj1bS9WnPztm 46sFYb9MDoU/K4MQPBcaKWoVNUGI84f4CtqcZDDEoPKm4n88jtp/5QZdON8wp5I+lvfx 4rMxaYdy35MBFaxOKaDCBV06psf7kGaTwE979BBf1e66t9j1g6eVhYkmWxa8+8/KMLEN EZd510MBpgJb+tem3lnYEXSYfROuOkHk3f89z9jfydZj3mSC8irtIz5hatG1CP8bdwdV bU/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=h+anUim6N8kPhedaRXqtOLw9+/rgUrHm7QzUFJPNxuM=; b=X4J6cTE6uZ3wQOOrIo/XbyV+odycXC6GoLiMV17wPFVo0Lfd7GLaCESBuDayy+hn95 1EFY7QMeW6bpCnp5jz/ox0n8FrBwe9Gw1sMn7fANQzgx8v2QPVL0QS+plO5SlvvFf5gW Jt9kKKlP80IkGkDnfW34XzD6qvrN5crc7r5wpjchpyQ4DgESLFHyyckNDr41fSPhJmof sjSY0D89Rf0kNKcDG6fcOBg92rvsoOz9LqRalRLQmoHTIDPISGy67E6Qv6IwZF4fVOyK Gk/rPSnuTcTMVRYHGfwgK2E5OwyWM7sYrRZuYBLSLn4g3r2MC1v64AdtBghq9cEMR7e9 YsrA== X-Gm-Message-State: AOAM532pFLAjBCogYeolMR1unoIxkJ7lpZ6tGVtck+62y2ecnrx5KJKu CL9rcd2T2pr1eCVIONF5kIvZRwcLPWXJaxw1V5C4 X-Received: by 2002:a17:90a:9294:b0:1b9:48e9:a030 with SMTP id n20-20020a17090a929400b001b948e9a030mr6559960pjo.200.1651609093031; Tue, 03 May 2022 13:18:13 -0700 (PDT) MIME-Version: 1.0 References: <20220502135907.31035-1-cgzones@googlemail.com> In-Reply-To: <20220502135907.31035-1-cgzones@googlemail.com> From: Paul Moore Date: Tue, 3 May 2022 16:18:02 -0400 Message-ID: Subject: Re: [PATCH] selinux: use unsigned char for boolean values To: =?UTF-8?Q?Christian_G=C3=B6ttsche?= Cc: selinux@vger.kernel.org, Stephen Smalley , Eric Paris , Austin Kim , Michal Orzel , Yang Li , Jiapeng Chong , Ondrej Mosnacek , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, 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 On Mon, May 2, 2022 at 9:59 AM Christian G=C3=B6ttsche wrote: > > Reported by sparse: > > security/selinux/selinuxfs.c:1483:30: warning: incorrect type in assi= gnment (different signedness) > security/selinux/selinuxfs.c:1483:30: expected unsigned int * > security/selinux/selinuxfs.c:1483:30: got int *[addressable] value= s > security/selinux/selinuxfs.c:1400:48: warning: incorrect type in argu= ment 3 (different signedness) > security/selinux/selinuxfs.c:1400:48: expected int *values > security/selinux/selinuxfs.c:1400:48: got unsigned int *bool_pendi= ng_values > > Also mark the read-only boolean array parameter of security_set_bools() > const. > > Signed-off-by: Christian G=C3=B6ttsche > --- > security/selinux/include/conditional.h | 4 ++-- > security/selinux/selinuxfs.c | 12 ++++++------ > security/selinux/ss/policydb.h | 2 +- > security/selinux/ss/services.c | 13 +++++++------ > 4 files changed, 16 insertions(+), 15 deletions(-) I could understand fixing the signed/unsigned type mismatch, but I don't quite understand the move from an int type to a char; is it simply to save space, i.e. 32-bits vs 8-bits? I think I would prefer either simply fixing the signed/unsigned mismatch and leaving the booleans as ints, or moving completely to a bool type, although that is likely to be much more involved. --=20 paul-moore.com