Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8875
b: refs/heads/master
c: ac4cec4
h: refs/heads/master
i:
  8873: b45b8ca
  8871: c79e325
v: v3
  • Loading branch information
David Woodhouse committed Jul 2, 2005
1 parent 3acac95 commit 62c2968
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b430437c0de81681ecfa8efa8f55823df733529
refs/heads/master: ac4cec443a80bfde829516e7a7db10f7325aa528
15 changes: 10 additions & 5 deletions trunk/kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ static int audit_rate_limit;

/* Number of outstanding audit_buffers allowed. */
static int audit_backlog_limit = 64;
static int audit_backlog_wait_time = 60 * HZ;
static int audit_backlog_wait_overflow = 0;

/* The identity of the user shutting down the audit system. */
uid_t audit_sig_uid = -1;
Expand Down Expand Up @@ -655,6 +657,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, int gfp_mask,
struct timespec t;
unsigned int serial;
int reserve;
unsigned long timeout_start = jiffies;

if (!audit_initialized)
return NULL;
Expand All @@ -667,21 +670,21 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, int gfp_mask,

while (audit_backlog_limit
&& skb_queue_len(&audit_skb_queue) > audit_backlog_limit + reserve) {
if (gfp_mask & __GFP_WAIT) {
int ret = 1;
if (gfp_mask & __GFP_WAIT && audit_backlog_wait_time
&& time_before(jiffies, timeout_start + audit_backlog_wait_time)) {

/* Wait for auditd to drain the queue a little */
DECLARE_WAITQUEUE(wait, current);
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&audit_backlog_wait, &wait);

if (audit_backlog_limit &&
skb_queue_len(&audit_skb_queue) > audit_backlog_limit)
ret = schedule_timeout(HZ * 60);
schedule_timeout(timeout_start + audit_backlog_wait_time - jiffies);

__set_current_state(TASK_RUNNING);
remove_wait_queue(&audit_backlog_wait, &wait);
if (ret)
continue;
continue;
}
if (audit_rate_check())
printk(KERN_WARNING
Expand All @@ -690,6 +693,8 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, int gfp_mask,
skb_queue_len(&audit_skb_queue),
audit_backlog_limit);
audit_log_lost("backlog limit exceeded");
audit_backlog_wait_time = audit_backlog_wait_overflow;
wake_up(&audit_backlog_wait);
return NULL;
}

Expand Down

0 comments on commit 62c2968

Please sign in to comment.