diff options
author | John Johansen <john.johansen@canonical.com> | 2022-04-20 01:25:55 +0200 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2022-10-03 23:49:03 +0200 |
commit | 8c4b785a86be1219f7d50f7b38266c454d6a9bbc (patch) | |
tree | 80e4ed818228d64dae3d8f5b90b009c0a2015e40 /security/apparmor/include/audit.h | |
parent | apparmor: extend permissions to support a label and tag string (diff) | |
download | linux-8c4b785a86be1219f7d50f7b38266c454d6a9bbc.tar.xz linux-8c4b785a86be1219f7d50f7b38266c454d6a9bbc.zip |
apparmor: add mediation class information to auditing
Audit messages currently don't contain the mediation class which can
make them less clear than they should be in some circumstances. With
newer mediation classes coming this potential confusion will become
worse.
Fix this by adding the mediatin class to the messages.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/include/audit.h')
-rw-r--r-- | security/apparmor/include/audit.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/security/apparmor/include/audit.h b/security/apparmor/include/audit.h index 18519a4eb67e..c328f07f11cd 100644 --- a/security/apparmor/include/audit.h +++ b/security/apparmor/include/audit.h @@ -107,6 +107,7 @@ enum audit_type { struct apparmor_audit_data { int error; int type; + u16 class; const char *op; struct aa_label *label; const char *name; @@ -155,9 +156,12 @@ struct apparmor_audit_data { /* macros for dealing with apparmor_audit_data structure */ #define aad(SA) ((SA)->apparmor_audit_data) -#define DEFINE_AUDIT_DATA(NAME, T, X) \ +#define DEFINE_AUDIT_DATA(NAME, T, C, X) \ /* TODO: cleanup audit init so we don't need _aad = {0,} */ \ - struct apparmor_audit_data NAME ## _aad = { .op = (X), }; \ + struct apparmor_audit_data NAME ## _aad = { \ + .class = (C), \ + .op = (X), \ + }; \ struct common_audit_data NAME = \ { \ .type = (T), \ |