Re: [PATCH] selinux: use int arrays for boolean values

From: Paul Moore
Date: Tue Aug 30 2022 - 17:04:57 EST


On Tue, Aug 30, 2022 at 11:45 AM Christian Göttsche
<cgzones@xxxxxxxxxxxxxx> wrote:
>
> Do not cast pointers of signed integers to pointers of unsigned integers
> and vice versa.
>
> It should currently not be an issue since they hold SELinux boolean
> values which should only contain either 0's or 1's, which should have
> the same representation.
>
> Reported by sparse:
>
> security/selinux/selinuxfs.c:1485:30: warning: incorrect type in assignment (different signedness)
> security/selinux/selinuxfs.c:1485:30: expected unsigned int *
> security/selinux/selinuxfs.c:1485:30: got int *[addressable] values
> security/selinux/selinuxfs.c:1402:48: warning: incorrect type in argument 3 (different signedness)
> security/selinux/selinuxfs.c:1402:48: expected int *values
> security/selinux/selinuxfs.c:1402:48: got unsigned int *bool_pending_values
>
> Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>
> ---
> Previous patch proposal: https://patchwork.kernel.org/project/selinux/patch/20220502135907.31035-1-cgzones@xxxxxxxxxxxxxx/
> ---
> security/selinux/selinuxfs.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)

Merged into selinux/next, thanks!

--
paul-moore.com