All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Markus Elfring <elfring@users.sourceforge.net>,
	Eric Paris <eparis@parisplace.org>,
	James Morris <james.l.morris@oracle.com>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	William Roberts <william.c.roberts@intel.com>,
	selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] selinux: Fix an uninitialized variable bug
Date: Fri, 31 Mar 2017 15:18:09 -0400	[thread overview]
Message-ID: <CAHC9VhT7njoVyHgyiTQhCcvZEYrTE_XZRLxT4+JJPiH3W88AUw@mail.gmail.com> (raw)
In-Reply-To: <1490975541.31110.12.camel@tycho.nsa.gov>

On Fri, Mar 31, 2017 at 11:52 AM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Fri, 2017-03-31 at 18:21 +0300, Dan Carpenter wrote:
>> We removed this initialization as a cleanup but it is probably
>> required.
>>
>> The concern is that "nel" can be zero.  I'm not an expert on SELinux
>> code but I think it looks possible to write an SELinux policy which
>> triggers this bug.  GCC doesn't catch this, but my static checker
>> does.
>>
>> Fixes: 9c312e79d6af ("selinux: Delete an unnecessary variable
>> initialisation in range_read()")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Nice catch, thanks!
>
> Acked-by: Stephen Smalley <sds@tycho.nsa.gov>

Yes, indeed.  Thanks Dan, I should have caught this when merging Markus' patch.

Merged.

>> diff --git a/security/selinux/ss/policydb.c
>> b/security/selinux/ss/policydb.c
>> index 658247f98dc1..0080122760ad 100644
>> --- a/security/selinux/ss/policydb.c
>> +++ b/security/selinux/ss/policydb.c
>> @@ -1832,7 +1832,7 @@ u32 string_to_av_perm(struct policydb *p, u16
>> tclass, const char *name)
>>
>>  static int range_read(struct policydb *p, void *fp)
>>  {
>> -     struct range_trans *rt;
>> +     struct range_trans *rt = NULL;
>>       struct mls_range *r = NULL;
>>       int i, rc;
>>       __le32 buf[2];

-- 
paul moore
www.paul-moore.com

WARNING: multiple messages have this Message-ID (diff)
From: Paul Moore <paul@paul-moore.com>
To: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] selinux: Fix an uninitialized variable bug
Date: Fri, 31 Mar 2017 19:18:09 +0000	[thread overview]
Message-ID: <CAHC9VhT7njoVyHgyiTQhCcvZEYrTE_XZRLxT4+JJPiH3W88AUw@mail.gmail.com> (raw)
In-Reply-To: <1490975541.31110.12.camel@tycho.nsa.gov>

On Fri, Mar 31, 2017 at 11:52 AM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Fri, 2017-03-31 at 18:21 +0300, Dan Carpenter wrote:
>> We removed this initialization as a cleanup but it is probably
>> required.
>>
>> The concern is that "nel" can be zero.  I'm not an expert on SELinux
>> code but I think it looks possible to write an SELinux policy which
>> triggers this bug.  GCC doesn't catch this, but my static checker
>> does.
>>
>> Fixes: 9c312e79d6af ("selinux: Delete an unnecessary variable
>> initialisation in range_read()")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Nice catch, thanks!
>
> Acked-by: Stephen Smalley <sds@tycho.nsa.gov>

Yes, indeed.  Thanks Dan, I should have caught this when merging Markus' patch.

Merged.

>> diff --git a/security/selinux/ss/policydb.c
>> b/security/selinux/ss/policydb.c
>> index 658247f98dc1..0080122760ad 100644
>> --- a/security/selinux/ss/policydb.c
>> +++ b/security/selinux/ss/policydb.c
>> @@ -1832,7 +1832,7 @@ u32 string_to_av_perm(struct policydb *p, u16
>> tclass, const char *name)
>>
>>  static int range_read(struct policydb *p, void *fp)
>>  {
>> -     struct range_trans *rt;
>> +     struct range_trans *rt = NULL;
>>       struct mls_range *r = NULL;
>>       int i, rc;
>>       __le32 buf[2];

-- 
paul moore
www.paul-moore.com

WARNING: multiple messages have this Message-ID (diff)
From: paul@paul-moore.com (Paul Moore)
To: linux-security-module@vger.kernel.org
Subject: [PATCH] selinux: Fix an uninitialized variable bug
Date: Fri, 31 Mar 2017 15:18:09 -0400	[thread overview]
Message-ID: <CAHC9VhT7njoVyHgyiTQhCcvZEYrTE_XZRLxT4+JJPiH3W88AUw@mail.gmail.com> (raw)
In-Reply-To: <1490975541.31110.12.camel@tycho.nsa.gov>

On Fri, Mar 31, 2017 at 11:52 AM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Fri, 2017-03-31 at 18:21 +0300, Dan Carpenter wrote:
>> We removed this initialization as a cleanup but it is probably
>> required.
>>
>> The concern is that "nel" can be zero.  I'm not an expert on SELinux
>> code but I think it looks possible to write an SELinux policy which
>> triggers this bug.  GCC doesn't catch this, but my static checker
>> does.
>>
>> Fixes: 9c312e79d6af ("selinux: Delete an unnecessary variable
>> initialisation in range_read()")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Nice catch, thanks!
>
> Acked-by: Stephen Smalley <sds@tycho.nsa.gov>

Yes, indeed.  Thanks Dan, I should have caught this when merging Markus' patch.

Merged.

>> diff --git a/security/selinux/ss/policydb.c
>> b/security/selinux/ss/policydb.c
>> index 658247f98dc1..0080122760ad 100644
>> --- a/security/selinux/ss/policydb.c
>> +++ b/security/selinux/ss/policydb.c
>> @@ -1832,7 +1832,7 @@ u32 string_to_av_perm(struct policydb *p, u16
>> tclass, const char *name)
>>
>>  static int range_read(struct policydb *p, void *fp)
>>  {
>> -     struct range_trans *rt;
>> +     struct range_trans *rt = NULL;
>>       struct mls_range *r = NULL;
>>       int i, rc;
>>       __le32 buf[2];

-- 
paul moore
www.paul-moore.com
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-03-31 19:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 15:21 [PATCH] selinux: Fix an uninitialized variable bug Dan Carpenter
2017-03-31 15:21 ` Dan Carpenter
2017-03-31 15:21 ` Dan Carpenter
2017-03-31 15:52 ` Stephen Smalley
2017-03-31 15:52   ` Stephen Smalley
2017-03-31 15:52   ` Stephen Smalley
2017-03-31 19:18   ` Paul Moore [this message]
2017-03-31 19:18     ` Paul Moore
2017-03-31 19:18     ` Paul Moore
2017-04-01  6:40     ` selinux: Fix an uninitialized variable bug in range_read() SF Markus Elfring
2017-04-01  6:40       ` SF Markus Elfring
2017-04-01  6:40       ` SF Markus Elfring
2017-04-01 14:52       ` Paul Moore
2017-04-01 14:52         ` Paul Moore
2017-04-01 14:52         ` Paul Moore
2017-04-03  1:10     ` [PATCH] selinux: Fix an uninitialized variable bug James Morris
2017-04-03  1:10       ` James Morris
2017-04-03  1:10       ` James Morris
2017-04-03 21:45       ` Paul Moore
2017-04-03 21:45         ` Paul Moore
2017-04-03 21:45         ` Paul Moore
2017-04-04  0:03         ` James Morris
2017-04-04  0:03           ` James Morris
2017-04-04  0:03           ` James Morris

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=CAHC9VhT7njoVyHgyiTQhCcvZEYrTE_XZRLxT4+JJPiH3W88AUw@mail.gmail.com \
    --to=paul@paul-moore.com \
    --cc=dan.carpenter@oracle.com \
    --cc=elfring@users.sourceforge.net \
    --cc=eparis@parisplace.org \
    --cc=james.l.morris@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=serge@hallyn.com \
    --cc=william.c.roberts@intel.com \
    /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.