diff mbox

[12/14] UBUNTU: SAUCE: apparmor: fix ns ref count link when removing profiles from policy

Message ID 20170201091310.22695-13-john.johansen@canonical.com
State New
Headers show

Commit Message

John Johansen Feb. 1, 2017, 9:13 a.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1660849
Signed-off-by: John Johansen <john.johansen@canonical.com>
---
 security/apparmor/policy.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index afa5984..f2ffcf1 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -1104,11 +1104,13 @@  ssize_t aa_remove_profiles(struct aa_ns *view, struct aa_label *label,
 
 	/* don't fail removal if audit fails */
 	(void) audit_policy(label, OP_PROF_RM, ns_name, name, info, error);
+	aa_put_ns(ns);
 	aa_put_profile(profile);
 	return size;
 
 fail_ns_lock:
 	mutex_unlock(&ns->lock);
+	aa_put_ns(ns);
 
 fail:
 	(void) audit_policy(label, OP_PROF_RM, ns_name, name, info, error);