[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHC9VhREW0Ez7g302J43qdxZwTxk87N-GmT59aUtEUjJu_ynJA@mail.gmail.com>
Date: Fri, 13 Oct 2017 18:40:21 -0400
From: Paul Moore <paul@...l-moore.com>
To: Thomas Meyer <thomas@...3r.de>
Cc: Stephen Smalley <sds@...ho.nsa.gov>,
Eric Paris <eparis@...isplace.org>,
James Morris <james.l.morris@...cle.com>, serge@...lyn.com,
selinux@...ho.nsa.gov, linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org,
Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [PATCH] selinux: Fix bool initialization/comparison
On Tue, Oct 10, 2017 at 7:19 PM, Casey Schaufler <casey@...aufler-ca.com> wrote:
> On 10/7/2017 7:02 AM, Thomas Meyer wrote:
>> Bool initializations should use true and false. Bool tests don't need
>> comparisons.
>>
>> Signed-off-by: Thomas Meyer <thomas@...3r.de>
>> ---
Hi Thomas,
Thank you for submitting this patch, but it really doesn't add any
value to the SELinux code so I'm not going to merge it at this time.
If you would like to contribute to SELinux there are a number of
issues open on our GitHub page that you could look into resolving,
those patches would be very welcome.
* https://github.com/SELinuxProject
-Paul
>> diff -u -p a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
>> --- a/security/selinux/ss/mls.c
>> +++ b/security/selinux/ss/mls.c
>> @@ -550,7 +550,7 @@ int mls_compute_sid(struct context *scon
>>
>> /* Fallthrough */
>> case AVTAB_CHANGE:
>> - if ((tclass == policydb.process_class) || (sock == true))
>> + if ((tclass == policydb.process_class) || (sock))
>
> How about
>
> + if ((tclass == policydb.process_class) || sock)
>
>> /* Use the process MLS attributes. */
>> return mls_context_cpy(newcontext, scontext);
>> else
>> diff -u -p a/security/selinux/ss/services.c b/security/selinux/ss/services.c
>> --- a/security/selinux/ss/services.c
>> +++ b/security/selinux/ss/services.c
>> @@ -1656,7 +1656,7 @@ static int security_compute_sid(u32 ssid
>> } else if (cladatum && cladatum->default_role == DEFAULT_TARGET) {
>> newcontext.role = tcontext->role;
>> } else {
>> - if ((tclass == policydb.process_class) || (sock == true))
>> + if ((tclass == policydb.process_class) || (sock))
>
> Excessive ()
>
>> newcontext.role = scontext->role;
>> else
>> newcontext.role = OBJECT_R_VAL;
>> @@ -1668,7 +1668,7 @@ static int security_compute_sid(u32 ssid
>> } else if (cladatum && cladatum->default_type == DEFAULT_TARGET) {
>> newcontext.type = tcontext->type;
>> } else {
>> - if ((tclass == policydb.process_class) || (sock == true)) {
>> + if ((tclass == policydb.process_class) || (sock)) {
>
> Excessive ()
>
>> /* Use the type of process. */
>> newcontext.type = scontext->type;
>> } else {
>>
>
--
paul moore
www.paul-moore.com
Powered by blists - more mailing lists