diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2015-02-23 15:37:59 -0500 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2015-02-23 15:37:59 -0500 |
commit | a77ed4e5689627b0e9ac0a3532521b31c6daa99c (patch) | |
tree | e2be701234c38f0cecf604cae24a1bcc3cef39df | |
parent | f1aaf26224bee779012aab136e5373ce3487982c (diff) |
audit: don't lose set wait time on first successful call to audit_log_start()
Copy the set wait time to a working value to avoid losing the set
value if the queue overflows.
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
-rw-r--r-- | kernel/audit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index c7e097a0d7af..2125cc40e921 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -107,6 +107,7 @@ static u32 audit_rate_limit; | |||
107 | * When set to zero, this means unlimited. */ | 107 | * When set to zero, this means unlimited. */ |
108 | static u32 audit_backlog_limit = 64; | 108 | static u32 audit_backlog_limit = 64; |
109 | #define AUDIT_BACKLOG_WAIT_TIME (60 * HZ) | 109 | #define AUDIT_BACKLOG_WAIT_TIME (60 * HZ) |
110 | static u32 audit_backlog_wait_time_master = AUDIT_BACKLOG_WAIT_TIME; | ||
110 | static u32 audit_backlog_wait_time = AUDIT_BACKLOG_WAIT_TIME; | 111 | static u32 audit_backlog_wait_time = AUDIT_BACKLOG_WAIT_TIME; |
111 | static u32 audit_backlog_wait_overflow = 0; | 112 | static u32 audit_backlog_wait_overflow = 0; |
112 | 113 | ||
@@ -338,7 +339,7 @@ static int audit_set_backlog_limit(u32 limit) | |||
338 | static int audit_set_backlog_wait_time(u32 timeout) | 339 | static int audit_set_backlog_wait_time(u32 timeout) |
339 | { | 340 | { |
340 | return audit_do_config_change("audit_backlog_wait_time", | 341 | return audit_do_config_change("audit_backlog_wait_time", |
341 | &audit_backlog_wait_time, timeout); | 342 | &audit_backlog_wait_time_master, timeout); |
342 | } | 343 | } |
343 | 344 | ||
344 | static int audit_set_enabled(u32 state) | 345 | static int audit_set_enabled(u32 state) |
@@ -843,7 +844,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
843 | s.lost = atomic_read(&audit_lost); | 844 | s.lost = atomic_read(&audit_lost); |
844 | s.backlog = skb_queue_len(&audit_skb_queue); | 845 | s.backlog = skb_queue_len(&audit_skb_queue); |
845 | s.feature_bitmap = AUDIT_FEATURE_BITMAP_ALL; | 846 | s.feature_bitmap = AUDIT_FEATURE_BITMAP_ALL; |
846 | s.backlog_wait_time = audit_backlog_wait_time; | 847 | s.backlog_wait_time = audit_backlog_wait_time_master; |
847 | audit_send_reply(skb, seq, AUDIT_GET, 0, 0, &s, sizeof(s)); | 848 | audit_send_reply(skb, seq, AUDIT_GET, 0, 0, &s, sizeof(s)); |
848 | break; | 849 | break; |
849 | } | 850 | } |
@@ -1394,7 +1395,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, | |||
1394 | return NULL; | 1395 | return NULL; |
1395 | } | 1396 | } |
1396 | 1397 | ||
1397 | audit_backlog_wait_time = AUDIT_BACKLOG_WAIT_TIME; | 1398 | audit_backlog_wait_time = audit_backlog_wait_time_master; |
1398 | 1399 | ||
1399 | ab = audit_buffer_alloc(ctx, gfp_mask, type); | 1400 | ab = audit_buffer_alloc(ctx, gfp_mask, type); |
1400 | if (!ab) { | 1401 | if (!ab) { |