From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Guy Briggs <rgb@redhat.com>,
Eric Paris <eparis@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
Dan Duval <dan.duval@oracle.com>,
Dave Kleikamp <dave.kleikamp@oracle.com>,
Chuck Anderson <chuck.anderson@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] audit: fix endless wait in audit_log_start()
Date: Wed, 18 Sep 2013 13:48:17 +0400 [thread overview]
Message-ID: <20130918094817.18754.8847.stgit@zurg> (raw)
In-Reply-To: <20130917152842.51158606ed46ec67b97b4448@linux-foundation.org>
After commit 829199197a430dade2519d54f5545c4a094393b8 audit emiters will block
forever if userspace daemon cannot handle backlog. After the timeout waiting
loop turns into busy loop and runs until daemon dies or returns back to work.
This is minimal patch for that bug.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Andrew Morton <akpm@linux-foundation.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>
---
kernel/audit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index 91e53d0..7b0e23a 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -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 -
jiffies;
- if ((long)sleep_time > 0)
+ if ((long)sleep_time > 0) {
wait_for_auditd(sleep_time);
- continue;
+ continue;
+ }
}
if (audit_rate_check() && printk_ratelimit())
printk(KERN_WARNING
next prev parent reply other threads:[~2013-09-18 9:48 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 22:21 [RFC] audit: avoid soft lockup in audit_log_start() Luiz Capitulino
2013-08-28 22:33 ` Andrew Morton
2013-08-28 22:54 ` Luiz Capitulino
2013-08-28 23:08 ` Andrew Morton
2013-08-29 0:49 ` Luiz Capitulino
2013-08-30 18:23 ` Luiz Capitulino
2013-09-09 14:32 ` Konstantin Khlebnikov
2013-09-09 14:54 ` Luiz Capitulino
2013-09-09 15:19 ` Konstantin Khlebnikov
2013-09-09 15:29 ` Luiz Capitulino
2013-09-09 15:42 ` Konstantin Khlebnikov
2013-09-10 16:03 ` Eric Paris
2013-09-10 17:45 ` Luiz Capitulino
2013-09-17 22:28 ` Andrew Morton
2013-09-17 22:54 ` Luiz Capitulino
2013-09-18 1:57 ` Richard Guy Briggs
2013-09-18 9:48 ` Konstantin Khlebnikov [this message]
2013-09-18 13:31 ` [PATCH] audit: fix endless wait " Richard Guy Briggs
2013-09-18 19:06 ` [PATCH 0/8] Audit backlog queue fixes related to soft lockup Richard Guy Briggs
2013-09-18 19:06 ` [PATCH 1/8] audit: avoid soft lockup due to audit_log_start() incorrect loop termination Richard Guy Briggs
2013-09-18 19:06 ` [PATCH 2/8] audit: reset audit backlog wait time after error recovery Richard Guy Briggs
2013-09-18 19:06 ` [PATCH 3/8] audit: make use of remaining sleep time from wait_for_auditd Richard Guy Briggs
2013-09-18 19:06 ` [PATCH 4/8] audit: efficiency fix 1: only wake up if queue shorter than backlog limit Richard Guy Briggs
2013-09-18 19:06 ` [PATCH 5/8] audit: efficiency fix 2: request exclusive wait since all need same resource Richard Guy Briggs
2013-09-18 19:06 ` [PATCH 6/8] audit: add boot option to override default backlog limit Richard Guy Briggs
2013-09-18 19:06 ` [PATCH 7/8] audit: clean up AUDIT_GET/SET local variables and future-proof API Richard Guy Briggs
2013-09-19 21:18 ` Steve Grubb
2013-09-20 14:47 ` Eric Paris
2013-09-23 16:38 ` Richard Guy Briggs
2013-09-18 19:06 ` [PATCH 8/8] audit: add audit_backlog_wait_time configuration option Richard Guy Briggs
2013-09-18 20:33 ` Eric Paris
2013-09-18 20:49 ` Richard Guy Briggs
2013-09-18 20:54 ` Eric Paris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130918094817.18754.8847.stgit@zurg \
--to=khlebnikov@openvz.org \
--cc=akpm@linux-foundation.org \
--cc=chuck.anderson@oracle.com \
--cc=dan.duval@oracle.com \
--cc=dave.kleikamp@oracle.com \
--cc=eparis@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rgb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox