mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Johansen <john.johansen@canonical.com>
To: linux-security-module@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 08/12] apparmor: make free_profile available outside of policy.c
Date: Sat, 20 Jul 2013 01:38:43 -0700	[thread overview]
Message-ID: <1374309527-7082-9-git-send-email-john.johansen@canonical.com> (raw)
In-Reply-To: <1374309527-7082-1-git-send-email-john.johansen@canonical.com>

Signed-off-by: John Johansen <john.johansen@canonical.com>
---
 security/apparmor/include/policy.h | 1 +
 security/apparmor/policy.c         | 9 ++++-----
 security/apparmor/policy_unpack.c  | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h
index 4eafdd8..8a68226 100644
--- a/security/apparmor/include/policy.h
+++ b/security/apparmor/include/policy.h
@@ -228,6 +228,7 @@ struct aa_namespace *aa_find_namespace(struct aa_namespace *root,
 void aa_free_replacedby_kref(struct kref *kref);
 struct aa_profile *aa_alloc_profile(const char *name);
 struct aa_profile *aa_new_null_profile(struct aa_profile *parent, int hat);
+void aa_free_profile(struct aa_profile *profile);
 void aa_free_profile_kref(struct kref *kref);
 struct aa_profile *aa_find_child(struct aa_profile *parent, const char *name);
 struct aa_profile *aa_lookup_profile(struct aa_namespace *ns, const char *name);
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index aee2e71..7a80b0c 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -307,7 +307,6 @@ fail_ns:
 	return NULL;
 }
 
-static void free_profile(struct aa_profile *profile);
 /**
  * free_namespace - free a profile namespace
  * @ns: the namespace to free  (MAYBE NULL)
@@ -324,7 +323,7 @@ static void free_namespace(struct aa_namespace *ns)
 	aa_put_namespace(ns->parent);
 
 	ns->unconfined->ns = NULL;
-	free_profile(ns->unconfined);
+	aa_free_profile(ns->unconfined);
 	kzfree(ns);
 }
 
@@ -568,7 +567,7 @@ void aa_free_replacedby_kref(struct kref *kref)
 }
 
 /**
- * free_profile - free a profile
+ * aa_free_profile - free a profile
  * @profile: the profile to free  (MAYBE NULL)
  *
  * Free a profile, its hats and null_profile. All references to the profile,
@@ -577,7 +576,7 @@ void aa_free_replacedby_kref(struct kref *kref)
  * If the profile was referenced from a task context, free_profile() will
  * be called from an rcu callback routine, so we must not sleep here.
  */
-static void free_profile(struct aa_profile *profile)
+void aa_free_profile(struct aa_profile *profile)
 {
 	AA_DEBUG("%s(%p)\n", __func__, profile);
 
@@ -612,7 +611,7 @@ static void aa_free_profile_rcu(struct rcu_head *head)
 	if (p->flags & PFLAG_NS_COUNT)
 		free_namespace(p->ns);
 	else
-		free_profile(p);
+		aa_free_profile(p);
 }
 
 /**
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 869c063..e52d508 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -615,7 +615,7 @@ fail:
 	else if (!name)
 		name = "unknown";
 	audit_iface(profile, name, "failed to unpack profile", e, error);
-	aa_put_profile(profile);
+	aa_free_profile(profile);
 
 	return ERR_PTR(error);
 }
@@ -764,7 +764,7 @@ int aa_unpack(void *udata, size_t size, struct list_head *lh, const char **ns)
 
 		error = verify_profile(profile);
 		if (error) {
-			aa_put_profile(profile);
+			aa_free_profile(profile);
 			goto fail;
 		}
 
-- 
1.8.1.2


  parent reply	other threads:[~2013-07-20  8:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20  8:38 [Patch 0/12] apparmor: add policy interface and convert to RCU John Johansen
2013-07-20  8:38 ` [PATCH 01/12] apparmor: enable users to query whether apparmor is enabled John Johansen
2013-07-20  8:38 ` [PATCH 02/12] apparmor: add a features/policy dir to interface John Johansen
2013-07-20  8:38 ` [PATCH 03/12] apparmor: provide base for multiple profiles to be replaced at once John Johansen
2013-07-20  8:38 ` [PATCH 04/12] apparmor: convert profile lists to RCU based locking John Johansen
2013-07-20  8:38 ` [PATCH 05/12] apparmor: change how profile replacement update is done John Johansen
2013-07-20  8:38 ` [PATCH 06/12] apparmor: update how unconfined is handled John Johansen
2013-07-20  8:38 ` [PATCH 07/12] apparmor: rework namespace free path John Johansen
2013-07-20  8:38 ` John Johansen [this message]
2013-07-20  8:38 ` [PATCH 09/12] apparmor: allow setting any profile into the unconfined state John Johansen
2013-07-20  8:38 ` [PATCH 10/12] apparmor: Add interface files for profiles and namespaces John Johansen
2013-07-20  8:38 ` [PATCH 11/12] apparmor: add an optional profile attachment string for profiles John Johansen
2013-07-20  8:38 ` [PATCH 12/12] apparmor: Add the profile introspection file to interface John Johansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374309527-7082-9-git-send-email-john.johansen@canonical.com \
    --to=john.johansen@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®