LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nick Kralevich <nnk@google.com>
To: Jeff Vander Stoep <jeffv@google.com>
Cc: Jeffrey Vander Stoep <jvanderstoep@gmail.com>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-security-module@vger.kernel.org,
	James Morris <james.l.morris@oracle.com>,
	Stephen Smalley <sds@tycho.nsa.gov>,
	SELinux <selinux@tycho.nsa.gov>
Subject: Re: [PATCH] avc: remove unnecessary pointer reassignment
Date: Thu, 26 Feb 2015 14:08:31 -0800	[thread overview]
Message-ID: <CAFJ0LnHbmx+oyAfLJvigebA3rHxtLhdROq=u2FQ+eFHG7t5+wA@mail.gmail.com> (raw)
In-Reply-To: <1424987742-15120-1-git-send-email-jeffv@google.com>

Acked-By: Nick Kralevich <nnk@google.com>

On Thu, Feb 26, 2015 at 1:54 PM, Jeff Vander Stoep <jeffv@google.com> 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>
> ---
>  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))
> --
> 2.2.0.rc0.207.ga3a616c
>
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov.



-- 
Nick Kralevich | Android Security | nnk@google.com | 650.214.4037

  reply	other threads:[~2015-02-26 22:08 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 [this message]
2015-02-27 13:15 ` Stephen Smalley
2015-03-04 18:07   ` Paul Moore
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='CAFJ0LnHbmx+oyAfLJvigebA3rHxtLhdROq=u2FQ+eFHG7t5+wA@mail.gmail.com' \
    --to=nnk@google.com \
    --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).