From: Paul Moore <paul@paul-moore.com>
To: linux-security-module@vger.kernel.org
Subject: Re: selinux: Fix an uninitialized variable bug in range_read()
Date: Sat, 01 Apr 2017 14:52:26 +0000 [thread overview]
Message-ID: <CAHC9VhT8nXOPpOy5sRpRYjVnj2oOgFGAzibgkj_ZpK7xyg35qg@mail.gmail.com> (raw)
In-Reply-To: <fb1cb81c-4b03-5b21-f933-ea3e58491a13@users.sourceforge.net>
On Sat, Apr 1, 2017 at 2:40 AM, SF Markus Elfring
<elfring@users.sourceforge.net> 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.
>
> How do you think about the possibility to call the function “range_read” only with
> a system configuration where the interface “le32_to_cpu” will be resolved to
> a positive value so that statements in the corresponding for loop will be executed
> at least once?
I suggest we leave this as-is for the moment.
--
paul moore
www.paul-moore.com
next prev parent reply other threads:[~2017-04-01 14:52 UTC|newest]
Thread overview: 8+ 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:52 ` Stephen Smalley
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 14:52 ` Paul Moore [this message]
2017-04-03 1:10 ` [PATCH] selinux: Fix an uninitialized variable bug James Morris
2017-04-03 21:45 ` Paul Moore
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=CAHC9VhT8nXOPpOy5sRpRYjVnj2oOgFGAzibgkj_ZpK7xyg35qg@mail.gmail.com \
--to=paul@paul-moore.com \
--cc=linux-security-module@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).