diff options
author | 2005-04-29 17:19:14 +0100 | |
---|---|---|
committer | 2005-04-29 17:19:14 +0100 | |
commit | 37509e749dc2072e667db806ef24b9e897f61b8a (patch) | |
tree | 62e8c43ba360a9d0584822b06126284e4db428b8 /kernel | |
parent | Add audit uid to netlink credentials (diff) | |
download | linux-37509e749dc2072e667db806ef24b9e897f61b8a.tar.gz linux-37509e749dc2072e667db806ef24b9e897f61b8a.tar.bz2 linux-37509e749dc2072e667db806ef24b9e897f61b8a.zip |
[AUDIT] Requeue messages at head of queue, up to audit_backlog
If netlink_unicast() fails, requeue the skb back at the head of the queue
it just came from, instead of the tail. And do so unless we've exceeded
the audit_backlog limit; not according to some other arbitrary limit.
From: Chris Wright <chrisw@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 587d3b2eba7f..4a697c73faec 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -142,7 +142,6 @@ struct audit_buffer { int total; int type; int pid; - int count; /* Times requeued */ }; void audit_set_type(struct audit_buffer *ab, int type) @@ -526,9 +525,9 @@ static inline int audit_log_drain(struct audit_buffer *ab) retval = netlink_unicast(audit_sock, skb, audit_pid, MSG_DONTWAIT); } - if (retval == -EAGAIN && ab->count < 5) { - ++ab->count; - skb_queue_tail(&ab->sklist, skb); + if (retval == -EAGAIN && + (atomic_read(&audit_backlog)) < audit_backlog_limit) { + skb_queue_head(&ab->sklist, skb); audit_log_end_irq(ab); return 1; } @@ -666,7 +665,6 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx) ab->total = 0; ab->type = AUDIT_KERNEL; ab->pid = 0; - ab->count = 0; #ifdef CONFIG_AUDITSYSCALL if (ab->ctx) |