summaryrefslogtreecommitdiff
path: root/security/apparmor/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/apparmor/lib.c')
-rw-r--r--security/apparmor/lib.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c
index 0c5c51c326fa..5d33252204fe 100644
--- a/security/apparmor/lib.c
+++ b/security/apparmor/lib.c
@@ -425,7 +425,7 @@ int aa_check_perms(struct aa_profile *profile, struct aa_perms *perms,
u32 request, struct apparmor_audit_data *ad,
void (*cb)(struct audit_buffer *, void *))
{
- int type, error;
+ int error;
u32 denied = request & (~perms->allow | perms->deny);
if (likely(!denied)) {
@@ -434,18 +434,10 @@ int aa_check_perms(struct aa_profile *profile, struct aa_perms *perms,
if (!request || !ad)
return 0;
- type = AUDIT_APPARMOR_AUDIT;
error = 0;
} else {
error = -EACCES;
- if (denied & perms->kill)
- type = AUDIT_APPARMOR_KILL;
- else if (denied == (denied & perms->complain))
- type = AUDIT_APPARMOR_ALLOWED;
- else
- type = AUDIT_APPARMOR_DENIED;
-
if (denied == (denied & perms->hide))
error = -ENOENT;
@@ -454,6 +446,8 @@ int aa_check_perms(struct aa_profile *profile, struct aa_perms *perms,
return error;
}
+ int type = aa_select_audit_type(denied, perms);
+
if (ad) {
ad->subj_label = &profile->label;
ad->request = request;