aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/apparmor/include/policy.h1
-rw-r--r--security/apparmor/policy.c9
-rw-r--r--security/apparmor/policy_unpack.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h
index 4eafdd88f44e..8a68226ff7f7 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,
228void aa_free_replacedby_kref(struct kref *kref); 228void aa_free_replacedby_kref(struct kref *kref);
229struct aa_profile *aa_alloc_profile(const char *name); 229struct aa_profile *aa_alloc_profile(const char *name);
230struct aa_profile *aa_new_null_profile(struct aa_profile *parent, int hat); 230struct aa_profile *aa_new_null_profile(struct aa_profile *parent, int hat);
231void aa_free_profile(struct aa_profile *profile);
231void aa_free_profile_kref(struct kref *kref); 232void aa_free_profile_kref(struct kref *kref);
232struct aa_profile *aa_find_child(struct aa_profile *parent, const char *name); 233struct aa_profile *aa_find_child(struct aa_profile *parent, const char *name);
233struct aa_profile *aa_lookup_profile(struct aa_namespace *ns, const char *name); 234struct 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 aee2e71827cd..7a80b0c7e0ce 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -307,7 +307,6 @@ fail_ns:
307 return NULL; 307 return NULL;
308} 308}
309 309
310static void free_profile(struct aa_profile *profile);
311/** 310/**
312 * free_namespace - free a profile namespace 311 * free_namespace - free a profile namespace
313 * @ns: the namespace to free (MAYBE NULL) 312 * @ns: the namespace to free (MAYBE NULL)
@@ -324,7 +323,7 @@ static void free_namespace(struct aa_namespace *ns)
324 aa_put_namespace(ns->parent); 323 aa_put_namespace(ns->parent);
325 324
326 ns->unconfined->ns = NULL; 325 ns->unconfined->ns = NULL;
327 free_profile(ns->unconfined); 326 aa_free_profile(ns->unconfined);
328 kzfree(ns); 327 kzfree(ns);
329} 328}
330 329
@@ -568,7 +567,7 @@ void aa_free_replacedby_kref(struct kref *kref)
568} 567}
569 568
570/** 569/**
571 * free_profile - free a profile 570 * aa_free_profile - free a profile
572 * @profile: the profile to free (MAYBE NULL) 571 * @profile: the profile to free (MAYBE NULL)
573 * 572 *
574 * Free a profile, its hats and null_profile. All references to the profile, 573 * 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)
577 * If the profile was referenced from a task context, free_profile() will 576 * If the profile was referenced from a task context, free_profile() will
578 * be called from an rcu callback routine, so we must not sleep here. 577 * be called from an rcu callback routine, so we must not sleep here.
579 */ 578 */
580static void free_profile(struct aa_profile *profile) 579void aa_free_profile(struct aa_profile *profile)
581{ 580{
582 AA_DEBUG("%s(%p)\n", __func__, profile); 581 AA_DEBUG("%s(%p)\n", __func__, profile);
583 582
@@ -612,7 +611,7 @@ static void aa_free_profile_rcu(struct rcu_head *head)
612 if (p->flags & PFLAG_NS_COUNT) 611 if (p->flags & PFLAG_NS_COUNT)
613 free_namespace(p->ns); 612 free_namespace(p->ns);
614 else 613 else
615 free_profile(p); 614 aa_free_profile(p);
616} 615}
617 616
618/** 617/**
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 080a26b11f01..ce15313896ee 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -616,7 +616,7 @@ fail:
616 else if (!name) 616 else if (!name)
617 name = "unknown"; 617 name = "unknown";
618 audit_iface(profile, name, "failed to unpack profile", e, error); 618 audit_iface(profile, name, "failed to unpack profile", e, error);
619 aa_put_profile(profile); 619 aa_free_profile(profile);
620 620
621 return ERR_PTR(error); 621 return ERR_PTR(error);
622} 622}
@@ -763,7 +763,7 @@ int aa_unpack(void *udata, size_t size, struct list_head *lh, const char **ns)
763 763
764 error = verify_profile(profile); 764 error = verify_profile(profile);
765 if (error) { 765 if (error) {
766 aa_put_profile(profile); 766 aa_free_profile(profile);
767 goto fail; 767 goto fail;
768 } 768 }
769 769