Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753716AbbB0Na7 (ORCPT ); Fri, 27 Feb 2015 08:30:59 -0500 Received: from emvm-gh1-uea09.nsa.gov ([63.239.67.10]:55034 "EHLO emvm-gh1-uea09.nsa.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753376AbbB0Na6 (ORCPT ); Fri, 27 Feb 2015 08:30:58 -0500 X-Greylist: delayed 851 seconds by postgrey-1.27 at vger.kernel.org; Fri, 27 Feb 2015 08:30:57 EST X-TM-IMSS-Message-ID: <1d51ee2f0004b42c@nsa.gov> Message-ID: <54F06DF1.8070605@tycho.nsa.gov> Date: Fri, 27 Feb 2015 08:15:29 -0500 From: Stephen Smalley Organization: National Security Agency User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jeff Vander Stoep , jvanderstoep@gmail.com CC: linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, James Morris , selinux@tycho.nsa.gov, Paul Moore , Eric Paris Subject: Re: [PATCH] avc: remove unnecessary pointer reassignment References: <1424987742-15120-1-git-send-email-jeffv@google.com> In-Reply-To: <1424987742-15120-1-git-send-email-jeffv@google.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1265 Lines: 39 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 Acked-by: Stephen Smalley > --- > 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)) > -- 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/