Commit 8ac1c8d5 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Linus Torvalds

audit: fix endless wait in audit_log_start()

After commit 82919919 ("kernel/audit.c: avoid negative sleep
durations") audit emitters will block forever if userspace daemon cannot
handle backlog.

After the timeout the waiting loop turns into busy loop and runs until
daemon dies or returns back to work.  This is a minimal patch for that
Signed-off-by: default avatarKonstantin Khlebnikov <>
Cc: Luiz Capitulino <>
Cc: Richard Guy Briggs <>
Cc: Eric Paris <>
Cc: Chuck Anderson <>
Cc: Dan Duval <>
Cc: Dave Kleikamp <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 0608f43d
......@@ -1117,9 +1117,10 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
sleep_time = timeout_start + audit_backlog_wait_time -
if ((long)sleep_time > 0)
if ((long)sleep_time > 0) {
if (audit_rate_check() && printk_ratelimit())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment