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

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>

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


  parent reply	other threads:[~2015-02-27 13:30 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 [this message]
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=54F06DF1.8070605@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --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=paul@paul-moore.com \
    --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).