diff options
author | John Johansen <john.johansen@canonical.com> | 2022-10-03 02:48:24 -0700 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2022-10-24 22:35:36 -0700 |
commit | 58f89ce58bb4f5cf5963b20a19aaa2431b0412d8 (patch) | |
tree | c2d790ece0ee8b71c048c3775a70801e5927acaf /security/apparmor/domain.c | |
parent | 1f2bc06a8dbff73957f433b22c6fd35fccfb47a4 (diff) | |
download | linux-stable-58f89ce58bb4f5cf5963b20a19aaa2431b0412d8.tar.gz linux-stable-58f89ce58bb4f5cf5963b20a19aaa2431b0412d8.tar.bz2 linux-stable-58f89ce58bb4f5cf5963b20a19aaa2431b0412d8.zip |
apparmor: refactor code that alloc null profiles
Bother unconfined and learning profiles use the null profile as their
base. Refactor so they are share a common base routine. This doesn't
save much atm but will be important when the feature set of the
parent is inherited.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/domain.c')
-rw-r--r-- | security/apparmor/domain.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index d4b09f061aee..b447bc13ea8e 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -681,8 +681,8 @@ static struct aa_label *profile_transition(struct aa_profile *profile, /* no exec permission - learning mode */ struct aa_profile *new_profile = NULL; - new_profile = aa_new_null_profile(profile, false, name, - GFP_KERNEL); + new_profile = aa_new_learning_profile(profile, false, name, + GFP_KERNEL); if (!new_profile) { error = -ENOMEM; info = "could not create null profile"; @@ -1009,8 +1009,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile, if (!hat) { error = -ENOENT; if (COMPLAIN_MODE(profile)) { - hat = aa_new_null_profile(profile, true, name, - GFP_KERNEL); + hat = aa_new_learning_profile(profile, true, name, + GFP_KERNEL); if (!hat) { info = "failed null profile create"; error = -ENOMEM; @@ -1361,8 +1361,8 @@ int aa_change_profile(const char *fqname, int flags) !COMPLAIN_MODE(labels_profile(label))) goto audit; /* released below */ - tprofile = aa_new_null_profile(labels_profile(label), false, - fqname, GFP_KERNEL); + tprofile = aa_new_learning_profile(labels_profile(label), false, + fqname, GFP_KERNEL); if (!tprofile) { info = "failed null profile create"; error = -ENOMEM; |