All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Ondrej Mosnacek <omosnace@redhat.com>,
	selinux@vger.kernel.org, Paul Moore <paul@paul-moore.com>
Subject: Re: [PATCH] selinux: fix sparse warnings in policydb.c
Date: Thu, 16 Jan 2020 11:08:01 -0500	[thread overview]
Message-ID: <c26b26d4-9fcd-8802-bf3b-f5e0f75a0730@tycho.nsa.gov> (raw)
In-Reply-To: <20200116131928.315533-1-omosnace@redhat.com>

On 1/16/20 8:19 AM, Ondrej Mosnacek wrote:
> Two places used u32 where there should have been __le32.
> 
> Fixes sparse warnings:
>    CHECK   [...]/security/selinux/ss/services.c
> [...]/security/selinux/ss/policydb.c:2669:16: warning: incorrect type in assignment (different base types)
> [...]/security/selinux/ss/policydb.c:2669:16:    expected unsigned int
> [...]/security/selinux/ss/policydb.c:2669:16:    got restricted __le32 [usertype]
> [...]/security/selinux/ss/policydb.c:2674:24: warning: incorrect type in assignment (different base types)
> [...]/security/selinux/ss/policydb.c:2674:24:    expected unsigned int
> [...]/security/selinux/ss/policydb.c:2674:24:    got restricted __le32 [usertype]
> [...]/security/selinux/ss/policydb.c:2675:24: warning: incorrect type in assignment (different base types)
> [...]/security/selinux/ss/policydb.c:2675:24:    expected unsigned int
> [...]/security/selinux/ss/policydb.c:2675:24:    got restricted __le32 [usertype]
> [...]/security/selinux/ss/policydb.c:2676:24: warning: incorrect type in assignment (different base types)
> [...]/security/selinux/ss/policydb.c:2676:24:    expected unsigned int
> [...]/security/selinux/ss/policydb.c:2676:24:    got restricted __le32 [usertype]
> [...]/security/selinux/ss/policydb.c:2681:32: warning: incorrect type in assignment (different base types)
> [...]/security/selinux/ss/policydb.c:2681:32:    expected unsigned int
> [...]/security/selinux/ss/policydb.c:2681:32:    got restricted __le32 [usertype]
> [...]/security/selinux/ss/policydb.c:2701:16: warning: incorrect type in assignment (different base types)
> [...]/security/selinux/ss/policydb.c:2701:16:    expected unsigned int
> [...]/security/selinux/ss/policydb.c:2701:16:    got restricted __le32 [usertype]
> [...]/security/selinux/ss/policydb.c:2706:24: warning: incorrect type in assignment (different base types)
> [...]/security/selinux/ss/policydb.c:2706:24:    expected unsigned int
> [...]/security/selinux/ss/policydb.c:2706:24:    got restricted __le32 [usertype]
> [...]/security/selinux/ss/policydb.c:2707:24: warning: incorrect type in assignment (different base types)
> [...]/security/selinux/ss/policydb.c:2707:24:    expected unsigned int
> [...]/security/selinux/ss/policydb.c:2707:24:    got restricted __le32 [usertype]
> 
> Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>

Reviewed-by: Stephen Smalley <sds@tycho.nsa.gov>

> ---
>   security/selinux/ss/policydb.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
> index e369b0092cdf..2aa7f2e1a8e7 100644
> --- a/security/selinux/ss/policydb.c
> +++ b/security/selinux/ss/policydb.c
> @@ -2659,7 +2659,7 @@ static int role_trans_write(struct policydb *p, void *fp)
>   {
>   	struct role_trans *r = p->role_tr;
>   	struct role_trans *tr;
> -	u32 buf[3];
> +	__le32 buf[3];
>   	size_t nel;
>   	int rc;
>   
> @@ -2691,7 +2691,7 @@ static int role_trans_write(struct policydb *p, void *fp)
>   static int role_allow_write(struct role_allow *r, void *fp)
>   {
>   	struct role_allow *ra;
> -	u32 buf[2];
> +	__le32 buf[2];
>   	size_t nel;
>   	int rc;
>   
> 


  reply	other threads:[~2020-01-16 16:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 13:19 [PATCH] selinux: fix sparse warnings in policydb.c Ondrej Mosnacek
2020-01-16 16:08 ` Stephen Smalley [this message]
2020-01-16 16:10   ` Stephen Smalley
2020-01-16 16:21     ` Ondrej Mosnacek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c26b26d4-9fcd-8802-bf3b-f5e0f75a0730@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=omosnace@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.