From patchwork Wed Feb 1 09:13:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Johansen X-Patchwork-Id: 722423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3vCy9q1Whwz9snk; Wed, 1 Feb 2017 20:14:07 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1cYqzM-0001xJ-1z; Wed, 01 Feb 2017 09:14:04 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1cYqz3-0001n8-DX for kernel-team@lists.ubuntu.com; Wed, 01 Feb 2017 09:13:45 +0000 Received: from static-50-53-52-155.bvtn.or.frontiernet.net ([50.53.52.155] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1cYqz2-0004P2-RL for kernel-team@lists.ubuntu.com; Wed, 01 Feb 2017 09:13:45 +0000 From: John Johansen To: kernel-team@lists.ubuntu.com Subject: [PATCH 12/14] UBUNTU: SAUCE: apparmor: fix ns ref count link when removing profiles from policy Date: Wed, 1 Feb 2017 01:13:08 -0800 Message-Id: <20170201091310.22695-13-john.johansen@canonical.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170201091310.22695-1-john.johansen@canonical.com> References: <20170201091310.22695-1-john.johansen@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com BugLink: http://bugs.launchpad.net/bugs/1660849 Signed-off-by: John Johansen --- 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);