LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Jeff Vander Stoep <jeffv@google.com>,
	jvanderstoep@gmail.com, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	James Morris <james.l.morris@oracle.com>,
	selinux@tycho.nsa.gov, Eric Paris <eparis@parisplace.org>
Subject: Re: [PATCH] avc: remove unnecessary pointer reassignment
Date: Wed, 4 Mar 2015 13:07:27 -0500	[thread overview]
Message-ID: <CAHC9VhRwTvimSHLToG9mkk5jiM7N3CJCR6pR2Sa_mJsHcDwtog@mail.gmail.com> (raw)
In-Reply-To: <54F06DF1.8070605@tycho.nsa.gov>

On Fri, Feb 27, 2015 at 8:15 AM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On 02/26/2015 04:54 PM, Jeff Vander Stoep wrote:
>> Commit f01e1af445fa ("selinux: don't pass in NULL avd to avc_has_perm_noaudit")
>> made this pointer reassignment unnecessary. Avd should continue to reference
>> the stack-based copy.
>>
>> Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
>
> Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>


Thanks everyone for the patch and the review.  I'll merge this next
week into selinux#next.

>> ---
>>  security/selinux/avc.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/security/selinux/avc.c b/security/selinux/avc.c
>> index afcc0ae..3c17dda 100644
>> --- a/security/selinux/avc.c
>> +++ b/security/selinux/avc.c
>> @@ -724,12 +724,10 @@ inline int avc_has_perm_noaudit(u32 ssid, u32 tsid,
>>       rcu_read_lock();
>>
>>       node = avc_lookup(ssid, tsid, tclass);
>> -     if (unlikely(!node)) {
>> +     if (unlikely(!node))
>>               node = avc_compute_av(ssid, tsid, tclass, avd);
>> -     } else {
>> +     else
>>               memcpy(avd, &node->ae.avd, sizeof(*avd));
>> -             avd = &node->ae.avd;
>> -     }
>>
>>       denied = requested & ~(avd->allowed);
>>       if (unlikely(denied))
>>
>



-- 
paul moore
www.paul-moore.com

  reply	other threads:[~2015-03-04 18:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 21:54 Jeff Vander Stoep
2015-02-26 22:08 ` Nick Kralevich
2015-02-27 13:15 ` Stephen Smalley
2015-03-04 18:07   ` Paul Moore [this message]
2015-03-09 19:34     ` Paul Moore

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=CAHC9VhRwTvimSHLToG9mkk5jiM7N3CJCR6pR2Sa_mJsHcDwtog@mail.gmail.com \
    --to=paul@paul-moore.com \
    --cc=eparis@parisplace.org \
    --cc=james.l.morris@oracle.com \
    --cc=jeffv@google.com \
    --cc=jvanderstoep@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --subject='Re: [PATCH] avc: remove unnecessary pointer reassignment' \
    /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

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).