SELinux Archive on lore.kernel.org
 help / color / Atom feed
From: Ondrej Mosnacek <omosnace@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: SElinux list <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 17:21:37 +0100
Message-ID: <CAFqZXNtuq2FYBbQenLpJarckXfmgyGC_f3XgB=d+ye_tSoLuuw@mail.gmail.com> (raw)
In-Reply-To: <ede9c1eb-2c60-44fd-336d-c8b802833393@tycho.nsa.gov>

On Thu, Jan 16, 2020 at 5:10 PM Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On 1/16/20 11:08 AM, Stephen Smalley wrote:
> > 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>
>
> However, note that checkpatch doesn't like your subject line.
> WARNING: A patch subject line should describe the change not the tool
> that found it

Hm, I run checkpatch.pl from a pre-commit git hook, so it likely only
looks at the diff itself... I'll see if I can tweak the hook to check
a full patch generated from the commit.

It has a good point, though. I'll reword the subject.

-- 
Ondrej Mosnacek <omosnace at redhat dot com>
Software Engineer, Security Technologies
Red Hat, Inc.


      reply index

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

Reply instructions:

You may reply publically 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='CAFqZXNtuq2FYBbQenLpJarckXfmgyGC_f3XgB=d+ye_tSoLuuw@mail.gmail.com' \
    --to=omosnace@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    --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

SELinux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux/0 selinux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux selinux/ https://lore.kernel.org/selinux \
		selinux@vger.kernel.org
	public-inbox-index selinux

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git