Re: [PATCH] avc: remove unnecessary pointer reassignment
On Wed, Mar 4, 2015 at 1:07 PM, Paul Moore wrote: > On Fri, Feb 27, 2015 at 8:15 AM, Stephen Smalley 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 >> >> Acked-by: Stephen Smalley > > Thanks everyone for the patch and the review. I'll merge this next > week into selinux#next. I apologize for the delay, but I just merged this into selinux#next; it should be in the next linux-next kernel. -- paul moore www.paul-moore.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] avc: remove unnecessary pointer reassignment
On Wed, Mar 4, 2015 at 1:07 PM, Paul Moore p...@paul-moore.com wrote: On Fri, Feb 27, 2015 at 8:15 AM, Stephen Smalley s...@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 je...@google.com Acked-by: Stephen Smalley s...@tycho.nsa.gov Thanks everyone for the patch and the review. I'll merge this next week into selinux#next. I apologize for the delay, but I just merged this into selinux#next; it should be in the next linux-next kernel. -- paul moore www.paul-moore.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] avc: remove unnecessary pointer reassignment
On Fri, Feb 27, 2015 at 8:15 AM, Stephen Smalley 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 > > Acked-by: Stephen Smalley 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, >ae.avd, sizeof(*avd)); >> - avd = >ae.avd; >> - } >> >> denied = requested & ~(avd->allowed); >> if (unlikely(denied)) >> > -- paul moore www.paul-moore.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] avc: remove unnecessary pointer reassignment
On Fri, Feb 27, 2015 at 8:15 AM, Stephen Smalley s...@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 je...@google.com Acked-by: Stephen Smalley s...@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 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] avc: remove unnecessary pointer reassignment
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, >ae.avd, sizeof(*avd)); > - avd = >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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] avc: remove unnecessary pointer reassignment
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 je...@google.com Acked-by: Stephen Smalley s...@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)) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] avc: remove unnecessary pointer reassignment
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, >ae.avd, sizeof(*avd)); > - avd = >ae.avd; > - } > > denied = requested & ~(avd->allowed); > if (unlikely(denied)) > -- > 2.2.0.rc0.207.ga3a616c > > ___ > Selinux mailing list > seli...@tycho.nsa.gov > To unsubscribe, send email to selinux-le...@tycho.nsa.gov. > To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov. -- Nick Kralevich | Android Security | n...@google.com | 650.214.4037 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] avc: remove unnecessary pointer reassignment
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, >ae.avd, sizeof(*avd)); - avd = >ae.avd; - } denied = requested & ~(avd->allowed); if (unlikely(denied)) -- 2.2.0.rc0.207.ga3a616c -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] avc: remove unnecessary pointer reassignment
Acked-By: Nick Kralevich n...@google.com On Thu, Feb 26, 2015 at 1:54 PM, Jeff Vander Stoep je...@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 je...@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 seli...@tycho.nsa.gov To unsubscribe, send email to selinux-le...@tycho.nsa.gov. To get help, send an email containing help to selinux-requ...@tycho.nsa.gov. -- Nick Kralevich | Android Security | n...@google.com | 650.214.4037 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] avc: remove unnecessary pointer reassignment
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 je...@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 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/