From: John Johansen Date: Sat, 16 Apr 2016 20:59:02 +0000 (-0700) Subject: apparmor: fix put() parent ref after updating the active ref X-Git-Tag: v3.12.70~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=723ace24a961a97711f2461affd52a4d91fd977b;p=thirdparty%2Fkernel%2Fstable.git apparmor: fix put() parent ref after updating the active ref commit f351841f8d41072e741e45299070d421a5833a4a upstream. Signed-off-by: John Johansen Acked-by: Seth Arnold Signed-off-by: Jiri Slaby --- diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index c92a9f6c1be5d..455c9f89f7e2e 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -1187,8 +1187,8 @@ ssize_t aa_replace_profiles(void *udata, size_t size, bool noreplace) /* parent replaced in this atomic set? */ if (newest != parent) { aa_get_profile(newest); - aa_put_profile(parent); rcu_assign_pointer(ent->new->parent, newest); + aa_put_profile(parent); } /* aafs interface uses replacedby */ rcu_assign_pointer(ent->new->replacedby->profile,