2 * AppArmor security module
4 * This file contains AppArmor auditing function definitions.
6 * Copyright (C) 1998-2008 Novell/SUSE
7 * Copyright 2009-2010 Canonical Ltd.
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
18 #include <linux/audit.h>
20 #include <linux/lsm_audit.h>
21 #include <linux/sched.h>
22 #include <linux/slab.h>
28 extern const char *const audit_mode_names[];
29 #define AUDIT_MAX_INDEX 5
31 AUDIT_NORMAL, /* follow normal auditing of accesses */
32 AUDIT_QUIET_DENIED, /* quiet all denied access messages */
33 AUDIT_QUIET, /* quiet all messages */
34 AUDIT_NOQUIET, /* do not quiet audit messages */
35 AUDIT_ALL /* audit all accesses */
40 AUDIT_APPARMOR_ALLOWED,
41 AUDIT_APPARMOR_DENIED,
43 AUDIT_APPARMOR_STATUS,
49 extern const char *const op_table[];
105 struct apparmor_audit_data {
131 /* define a short hand for apparmor_audit_data structure */
132 #define aad apparmor_audit_data
134 void aa_audit_msg(int type, struct common_audit_data *sa,
135 void (*cb) (struct audit_buffer *, void *));
136 int aa_audit(int type, struct aa_profile *profile, gfp_t gfp,
137 struct common_audit_data *sa,
138 void (*cb) (struct audit_buffer *, void *));
140 static inline int complain_error(int error)
142 if (error == -EPERM || error == -EACCES)
147 #endif /* __AA_AUDIT_H */