hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/security/apparmor/audit.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * AppArmor security module
34 *
....@@ -5,11 +6,6 @@
56 *
67 * Copyright (C) 1998-2008 Novell/SUSE
78 * Copyright 2009-2010 Canonical Ltd.
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License as
11
- * published by the Free Software Foundation, version 2 of the
12
- * License.
139 */
1410
1511 #include <linux/audit.h>
....@@ -61,18 +57,16 @@
6157 struct common_audit_data *sa = ca;
6258
6359 if (aa_g_audit_header) {
64
- audit_log_format(ab, "apparmor=");
65
- audit_log_string(ab, aa_audit_type[aad(sa)->type]);
60
+ audit_log_format(ab, "apparmor=\"%s\"",
61
+ aa_audit_type[aad(sa)->type]);
6662 }
6763
6864 if (aad(sa)->op) {
69
- audit_log_format(ab, " operation=");
70
- audit_log_string(ab, aad(sa)->op);
65
+ audit_log_format(ab, " operation=\"%s\"", aad(sa)->op);
7166 }
7267
7368 if (aad(sa)->info) {
74
- audit_log_format(ab, " info=");
75
- audit_log_string(ab, aad(sa)->info);
69
+ audit_log_format(ab, " info=\"%s\"", aad(sa)->info);
7670 if (aad(sa)->error)
7771 audit_log_format(ab, " error=%d", aad(sa)->error);
7872 }
....@@ -143,7 +137,7 @@
143137 }
144138 if (AUDIT_MODE(profile) == AUDIT_QUIET ||
145139 (type == AUDIT_APPARMOR_DENIED &&
146
- AUDIT_MODE(profile) == AUDIT_QUIET))
140
+ AUDIT_MODE(profile) == AUDIT_QUIET_DENIED))
147141 return aad(sa)->error;
148142
149143 if (KILL_MODE(profile) && type == AUDIT_APPARMOR_DENIED)
....@@ -226,8 +220,7 @@
226220 return 0;
227221 }
228222
229
-int aa_audit_rule_match(u32 sid, u32 field, u32 op, void *vrule,
230
- struct audit_context *actx)
223
+int aa_audit_rule_match(u32 sid, u32 field, u32 op, void *vrule)
231224 {
232225 struct aa_audit_rule *rule = vrule;
233226 struct aa_label *label;