diff options
| -rw-r--r-- | kernel/audit.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index b447a6b1fdc8..f20eee0db7e6 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
| @@ -1488,11 +1488,19 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, | |||
| 1488 | if (unlikely(!audit_filter(type, AUDIT_FILTER_TYPE))) | 1488 | if (unlikely(!audit_filter(type, AUDIT_FILTER_TYPE))) |
| 1489 | return NULL; | 1489 | return NULL; |
| 1490 | 1490 | ||
| 1491 | /* don't ever fail/sleep on auditd since we need auditd to drain the | 1491 | /* don't ever fail/sleep on these two conditions: |
| 1492 | * queue; also, when we are checking for auditd, compare PIDs using | 1492 | * 1. auditd generated record - since we need auditd to drain the |
| 1493 | * task_tgid_vnr() since auditd_pid is set in audit_receive_msg() using | 1493 | * queue; also, when we are checking for auditd, compare PIDs using |
| 1494 | * a PID anchored in the caller's namespace */ | 1494 | * task_tgid_vnr() since auditd_pid is set in audit_receive_msg() |
| 1495 | if (!(audit_pid && audit_pid == task_tgid_vnr(current))) { | 1495 | * using a PID anchored in the caller's namespace |
| 1496 | * 2. audit command message - record types 1000 through 1099 inclusive | ||
| 1497 | * are command messages/records used to manage the kernel subsystem | ||
| 1498 | * and the audit userspace, blocking on these messages could cause | ||
| 1499 | * problems under load so don't do it (note: not all of these | ||
| 1500 | * command types are valid as record types, but it is quicker to | ||
| 1501 | * just check two ints than a series of ints in a if/switch stmt) */ | ||
| 1502 | if (!((audit_pid && audit_pid == task_tgid_vnr(current)) || | ||
| 1503 | (type >= 1000 && type <= 1099))) { | ||
| 1496 | long sleep_time = audit_backlog_wait_time; | 1504 | long sleep_time = audit_backlog_wait_time; |
| 1497 | 1505 | ||
| 1498 | while (audit_backlog_limit && | 1506 | while (audit_backlog_limit && |
