All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Seth Forshee <seth.forshee@canonical.com>
Cc: linux-audit@redhat.com
Subject: Re: [PATCH] audit: make sure we don't let the retry queue grow without bounds
Date: Tue, 11 Apr 2017 10:44:22 -0400	[thread overview]
Message-ID: <CAHC9VhRAMPu5umZKh=xOZgObcjfJ7F3mqLqBy-54FbWyL=LNdg@mail.gmail.com> (raw)
In-Reply-To: <20170411023928.GG4689@ubuntu-hedt>

On Mon, Apr 10, 2017 at 10:39 PM, Seth Forshee
<seth.forshee@canonical.com> wrote:
> On Mon, Apr 10, 2017 at 04:54:27PM -0400, Paul Moore wrote:
>> From: Paul Moore <paul@paul-moore.com>
>>
>> The retry queue is intended to provide a temporary buffer in the case
>> of transient errors when communicating with auditd, it is not meant
>> as a long life queue, that functionality is provided by the hold
>> queue.
>>
>> This patch fixes a problem identified by Seth where the retry queue
>> could grow uncontrollably if an auditd instance did not connect to
>> the kernel to drain the queues.  This commit fixes this by doing the
>> following:
>>
>> * Make sure we always call auditd_reset() if we decide the connection
>> with audit is really dead.  There were some cases in
>> kauditd_hold_skb() where we did not reset the connection, this patch
>> relocates the reset calls to kauditd_thread() so all the error
>> conditions are caught and the connection reset.  As a side effect,
>> this means we could move auditd_reset() and get rid of the forward
>> definition at the top of kernel/audit.c.
>>
>> * We never checked the status of the auditd connection when
>> processing the main audit queue which meant that the retry queue
>> could grow unchecked.  This patch adds a call to auditd_reset()
>> after the main queue has been processed if auditd is not connected,
>> the auditd_reset() call will make sure the retry and hold queues are
>> correctly managed/flushed so that the retry queue remains reasonable.
>>
>> Reported-by: Seth Forshee <seth.forshee@canonical.com>
>> Signed-off-by: Paul Moore <paul@paul-moore.com>
>
> That fixes the issues I reported. The fix is also needed in 4.10 stable.

Great, thanks for testing.  I'll mark it for stable and send it up to Linus.

-- 
paul moore
www.paul-moore.com

      reply	other threads:[~2017-04-11 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 20:54 [PATCH] audit: make sure we don't let the retry queue grow without bounds Paul Moore
2017-04-10 21:04 ` Paul Moore
2017-04-11  2:39 ` Seth Forshee
2017-04-11 14:44   ` Paul Moore [this message]

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='CAHC9VhRAMPu5umZKh=xOZgObcjfJ7F3mqLqBy-54FbWyL=LNdg@mail.gmail.com' \
    --to=paul@paul-moore.com \
    --cc=linux-audit@redhat.com \
    --cc=seth.forshee@canonical.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.