diff options
Diffstat (limited to 'security/lsm_audit.c')
-rw-r--r-- | security/lsm_audit.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/security/lsm_audit.c b/security/lsm_audit.c index 90c129b0102f..8d8d97dbb389 100644 --- a/security/lsm_audit.c +++ b/security/lsm_audit.c | |||
@@ -213,12 +213,15 @@ static void dump_common_audit_data(struct audit_buffer *ab, | |||
213 | { | 213 | { |
214 | struct task_struct *tsk = current; | 214 | struct task_struct *tsk = current; |
215 | 215 | ||
216 | if (a->tsk) | 216 | /* |
217 | tsk = a->tsk; | 217 | * To keep stack sizes in check force programers to notice if they |
218 | if (tsk && tsk->pid) { | 218 | * start making this union too large! See struct lsm_network_audit |
219 | audit_log_format(ab, " pid=%d comm=", tsk->pid); | 219 | * as an example of how to deal with large data. |
220 | audit_log_untrustedstring(ab, tsk->comm); | 220 | */ |
221 | } | 221 | BUILD_BUG_ON(sizeof(a->u) > sizeof(void *)*2); |
222 | |||
223 | audit_log_format(ab, " pid=%d comm=", tsk->pid); | ||
224 | audit_log_untrustedstring(ab, tsk->comm); | ||
222 | 225 | ||
223 | switch (a->type) { | 226 | switch (a->type) { |
224 | case LSM_AUDIT_DATA_NONE: | 227 | case LSM_AUDIT_DATA_NONE: |