diff options
Diffstat (limited to 'security/selinux/selinuxfs.c')
-rw-r--r-- | security/selinux/selinuxfs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index f5d78365488f..a4efc966f065 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/major.h> | 22 | #include <linux/major.h> |
23 | #include <linux/seq_file.h> | 23 | #include <linux/seq_file.h> |
24 | #include <linux/percpu.h> | 24 | #include <linux/percpu.h> |
25 | #include <linux/audit.h> | ||
25 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
26 | #include <asm/semaphore.h> | 27 | #include <asm/semaphore.h> |
27 | 28 | ||
@@ -127,6 +128,10 @@ static ssize_t sel_write_enforce(struct file * file, const char __user * buf, | |||
127 | length = task_has_security(current, SECURITY__SETENFORCE); | 128 | length = task_has_security(current, SECURITY__SETENFORCE); |
128 | if (length) | 129 | if (length) |
129 | goto out; | 130 | goto out; |
131 | audit_log(current->audit_context, GFP_KERNEL, AUDIT_MAC_STATUS, | ||
132 | "enforcing=%d old_enforcing=%d auid=%u", new_value, | ||
133 | selinux_enforcing, | ||
134 | audit_get_loginuid(current->audit_context)); | ||
130 | selinux_enforcing = new_value; | 135 | selinux_enforcing = new_value; |
131 | if (selinux_enforcing) | 136 | if (selinux_enforcing) |
132 | avc_ss_reset(0); | 137 | avc_ss_reset(0); |
@@ -177,6 +182,9 @@ static ssize_t sel_write_disable(struct file * file, const char __user * buf, | |||
177 | length = selinux_disable(); | 182 | length = selinux_disable(); |
178 | if (length < 0) | 183 | if (length < 0) |
179 | goto out; | 184 | goto out; |
185 | audit_log(current->audit_context, GFP_KERNEL, AUDIT_MAC_STATUS, | ||
186 | "selinux=0 auid=%u", | ||
187 | audit_get_loginuid(current->audit_context)); | ||
180 | } | 188 | } |
181 | 189 | ||
182 | length = count; | 190 | length = count; |
@@ -262,6 +270,9 @@ static ssize_t sel_write_load(struct file * file, const char __user * buf, | |||
262 | length = ret; | 270 | length = ret; |
263 | else | 271 | else |
264 | length = count; | 272 | length = count; |
273 | audit_log(current->audit_context, GFP_KERNEL, AUDIT_MAC_POLICY_LOAD, | ||
274 | "policy loaded auid=%u", | ||
275 | audit_get_loginuid(current->audit_context)); | ||
265 | out: | 276 | out: |
266 | mutex_unlock(&sel_mutex); | 277 | mutex_unlock(&sel_mutex); |
267 | vfree(data); | 278 | vfree(data); |