summaryrefslogtreecommitdiffstats
path: root/security/apparmor/policy.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2017-01-16 00:42:35 -0800
committerJohn Johansen <john.johansen@canonical.com>2017-01-16 01:18:29 -0800
commit30b026a8d16bfa15bc24f4cca1604e47ac1a2f64 (patch)
tree56adf76fcfa79ed096ac06f5cfe9decf85d406b8 /security/apparmor/policy.c
parent73688d1ed0b8f800f312f7bc9d583463858da861 (diff)
downloadop-kernel-dev-30b026a8d16bfa15bc24f4cca1604e47ac1a2f64.zip
op-kernel-dev-30b026a8d16bfa15bc24f4cca1604e47ac1a2f64.tar.gz
apparmor: pass gfp_t parameter into profile allocation
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/policy.c')
-rw-r--r--security/apparmor/policy.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index e02ab20..e310f3b 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -255,24 +255,25 @@ void aa_free_profile_kref(struct kref *kref)
/**
* aa_alloc_profile - allocate, initialize and return a new profile
* @hname: name of the profile (NOT NULL)
+ * @gfp: allocation type
*
* Returns: refcount profile or NULL on failure
*/
-struct aa_profile *aa_alloc_profile(const char *hname)
+struct aa_profile *aa_alloc_profile(const char *hname, gfp_t gfp)
{
struct aa_profile *profile;
/* freed by free_profile - usually through aa_put_profile */
- profile = kzalloc(sizeof(*profile), GFP_KERNEL);
+ profile = kzalloc(sizeof(*profile), gfp);
if (!profile)
return NULL;
- profile->proxy = kzalloc(sizeof(struct aa_proxy), GFP_KERNEL);
+ profile->proxy = kzalloc(sizeof(struct aa_proxy), gfp);
if (!profile->proxy)
goto fail;
kref_init(&profile->proxy->count);
- if (!aa_policy_init(&profile->base, NULL, hname, GFP_KERNEL))
+ if (!aa_policy_init(&profile->base, NULL, hname, gfp))
goto fail;
kref_init(&profile->count);
@@ -312,7 +313,7 @@ struct aa_profile *aa_new_null_profile(struct aa_profile *parent, int hat)
goto fail;
sprintf(name, "%s//null-%x", parent->base.hname, uniq);
- profile = aa_alloc_profile(name);
+ profile = aa_alloc_profile(name, GFP_KERNEL);
kfree(name);
if (!profile)
goto fail;
OpenPOWER on IntegriCloud