提交 8ac1c8d5 编写于 作者: K Konstantin Khlebnikov 提交者: 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
bug.
Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Richard Guy Briggs <rgb@redhat.com>
Cc: Eric Paris <eparis@redhat.com>
Cc: Chuck Anderson <chuck.anderson@oracle.com>
Cc: Dan Duval <dan.duval@oracle.com>
Cc: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 0608f43d
...@@ -1117,9 +1117,10 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, ...@@ -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 - sleep_time = timeout_start + audit_backlog_wait_time -
jiffies; jiffies;
if ((long)sleep_time > 0) if ((long)sleep_time > 0) {
wait_for_auditd(sleep_time); wait_for_auditd(sleep_time);
continue; continue;
}
} }
if (audit_rate_check() && printk_ratelimit()) if (audit_rate_check() && printk_ratelimit())
printk(KERN_WARNING printk(KERN_WARNING
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册