Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754621AbbBZWIe (ORCPT ); Thu, 26 Feb 2015 17:08:34 -0500 Received: from mail-vc0-f180.google.com ([209.85.220.180]:63607 "EHLO mail-vc0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754458AbbBZWIc (ORCPT ); Thu, 26 Feb 2015 17:08:32 -0500 MIME-Version: 1.0 In-Reply-To: <1424987742-15120-1-git-send-email-jeffv@google.com> References: <1424987742-15120-1-git-send-email-jeffv@google.com> Date: Thu, 26 Feb 2015 14:08:31 -0800 Message-ID: Subject: Re: [PATCH] avc: remove unnecessary pointer reassignment From: Nick Kralevich To: Jeff Vander Stoep Cc: Jeffrey Vander Stoep , lkml , linux-security-module@vger.kernel.org, James Morris , Stephen Smalley , SELinux Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1714 Lines: 49 Acked-By: Nick Kralevich On Thu, Feb 26, 2015 at 1: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 > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/