From: John Johansen <john.johansen@canonical.com>
Date: Thu, 1 Oct 2015 11:57:52 -0700
Subject: [PATCH] apparmor: temporary work around for bug while unloading policy
Patch-mainline: TBD
References: boo#941867

Buglink: https://bugzilla.opensuse.org/show_bug.cgi?id=941867

This patch will stop the bug() call from triggering while unloading/
replacing policy. It does not address the root cause of the issue
but will only cause some memory leakage of the sub policies that
should have been freed before the current profile being destroyed.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 security/apparmor/policy.c |    2 --
 1 file changed, 2 deletions(-)

--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -157,12 +157,10 @@ static void policy_destroy(struct aa_pol
 		AA_ERROR("%s: internal error, "
 			 "policy '%s' still contains profiles\n",
 			 __func__, policy->name);
-		BUG();
 	}
 	if (on_list_rcu(&policy->list)) {
 		AA_ERROR("%s: internal error, policy '%s' still on list\n",
 			 __func__, policy->name);
-		BUG();
 	}
 
 	/* don't free name as its a subset of hname */
