[PATCH 08/11] UBUNTU: SAUCE: apparmor: fix ns ref count link when removing profiles from policy

John Johansen john.johansen at canonical.com
Fri Mar 31 12:57:41 UTC 2017


BugLink: http://bugs.launchpad.net/bugs/1660849
Signed-off-by: John Johansen <john.johansen at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
Acked-by: Tim Gardner <tim.gardner at canonical.com>
Acked-by: Brad Figg <brad.figg at canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
---
 security/apparmor/policy.c | 2 ++
 1 file changed, 2 insertions(+)

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);
-- 
2.9.3





More information about the kernel-team mailing list