Linux-audit Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Li,Rongqing" <lirongqing@baidu.com>
To: Paul Moore <paul@paul-moore.com>
Cc: "linux-audit@redhat.com" <linux-audit@redhat.com>
Subject: 答复: [PATCH][RFC] audit: set wait time to zero when audit failed
Date: Mon, 16 Sep 2019 02:55:23 +0000	[thread overview]
Message-ID: <f0efb280c80342049d4c43c9acb42676@baidu.com> (raw)
In-Reply-To: <CAHC9VhRXj2UpdijxpKgMROfNu9tETpXpHdboPqP=HvVF-GuBVQ@mail.gmail.com>

> >
> > if audit_log_start failed because queue is full, kauditd is waiting
> > the receiving queue empty, but no receiver, a task will be forced to
> > wait 60 seconds for each audited syscall, and it will be hang for a
> > very long time
> >
> > so at this condition, set the wait time to zero to reduce wait, and
> > restore wait time when audit works again
> >
> > it partially restore the commit 3197542482df ("audit: rework
> > audit_log_start()")
> >
> > Signed-off-by: Li RongQing <lirongqing@baidu.com>
> > Signed-off-by: Liang ZhiCheng <liangzhicheng@baidu.com>
> > ---
> > reboot is taking a very long time on my machine(centos 6u4 +kernel
> > 5.3) since TIF_SYSCALL_AUDIT is set by default, and when reboot,
> > userspace process which receiver audit message , will be killed, and
> > lead to that no user drain the audit queue
> >
> > git bitsect show it is caused by 3197542482df ("audit: rework
> > audit_log_start()")
> >
> >  kernel/audit.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> This is typically solved by increasing the backlog using the "audit_backlog_limit"
> kernel parameter (link to the docs below). 

It should be able to avoid my issue, but the default behaviors does not working for me; And not all have enough knowledge about audit, who maybe spend lots of effort to find the root cause, and estimate how large should be "audit_backlog_limit"

> You might also want to investigate
> what is generating some many audit records prior to starting the audit
> daemon.
> 
It is /sbin/readahead-collector, in fact, we stop the auditd; We are doing a reboot test, which rebooting machine continue to test hardware/software.

it is same as below:
auditctl -a always,exit -S all -F pid='xxx'
kill -s 19 `pidof auditd`

then the audited task will be hung

-RongQing

  reply	other threads:[~2019-09-16  2:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  3:19 [PATCH][RFC] audit: set wait time to zero when audit failed Li RongQing
2019-09-12 13:01 ` Paul Moore
2019-09-16  2:55   ` Li,Rongqing [this message]
2019-09-16 22:52     ` Paul Moore
2019-09-17  1:08       ` 答复: " Li,Rongqing
2019-09-17 19:16         ` Paul Moore
2019-09-18  1:07           ` 答复: " Li,Rongqing
2019-09-18 12:23             ` Paul Moore
2019-09-19  1:50               ` 答复: " Li,Rongqing
2019-09-19  2:30                 ` Paul Moore
2019-09-19  2:33                 ` Steve Grubb
2019-09-19  7:12                   ` 答复: " Li,Rongqing
2019-09-19 14:04                   ` Richard Guy Briggs

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=f0efb280c80342049d4c43c9acb42676@baidu.com \
    --to=lirongqing@baidu.com \
    --cc=linux-audit@redhat.com \
    --cc=paul@paul-moore.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