audit.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Chris Riches <chris.riches@nutanix.com>
Cc: audit@vger.kernel.org, Eric Paris <eparis@redhat.com>,
	jonathan.davies@nutanix.com,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] audit: Send netlink ACK before setting connection in auditd_set
Date: Sun, 12 Nov 2023 22:36:24 -0500	[thread overview]
Message-ID: <CAHC9VhQryMhepfZwoVmb6Svs7uq9vJ-oa0S7Lc6v7jyhiGvm_g@mail.gmail.com> (raw)
In-Reply-To: <c5f6bd1dee4ad9b43fc8c9dc1c7645b3.paul@paul-moore.com>

On Tue, Nov 7, 2023 at 6:31 PM Paul Moore <paul@paul-moore.com> wrote:
> On Oct 18, 2023 Paul Moore <paul@paul-moore.com> wrote:
> >
> > When auditd_set sets the auditd_conn pointer, audit messages can
> > immediately be put on the socket by other kernel threads. If the backlog
> > is large or the rate is high, this can immediately fill the socket
> > buffer. If the audit daemon requested an ACK for this operation, a full
> > socket buffer causes the ACK to get dropped, also setting ENOBUFS on the
> > socket.
> >
> > To avoid this race and ensure ACKs get through, fast-track the ACK in
> > this specific case to ensure it is sent before auditd_conn is set.
> >
> > Signed-off-by: Chris Riches <chris.riches@nutanix.com>
> > ---
> >
> > > I'm happier with the bool over the integer type for the @ack variable.
> > > I'd suggest updating the patch and posting it again so we can review
> > > it in full, but we weren't very far off last time so I think it should
> > > be close, if not acceptable on the next revision.
> >
> > Here's the latest iteration of the suggested patch. I've done it via git
> > send-email so it should apply cleanly.
> >
> >  kernel/audit.c | 31 ++++++++++++++++++++++++-------
> >  1 file changed, 24 insertions(+), 7 deletions(-)
>
> This looks good to me, thanks for your patience and persistence Chris.
>
> I'm going to merge this into audit/dev-staging now and it will move to
> audit/dev once v6.7-rc1 is released and the merge window closes.

I've now merged this into lsm/dev, thanks again Chris.

-- 
paul-moore.com

      reply	other threads:[~2023-11-13  3:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 15:27 [RFC PATCH] audit: Send netlink ACK before setting connection in auditd_set Chris Riches
2023-09-26 21:27 ` Paul Moore
2023-10-11 17:55 ` Paul Moore
2023-10-16 17:11   ` Chris Riches
2023-10-16 20:16     ` Paul Moore
2023-10-17 13:49       ` Chris Riches
2023-10-17 21:20         ` Paul Moore
2023-10-18  9:23           ` [PATCH v2] " Chris Riches
2023-10-18 12:11             ` Rinat Gadelshin
2023-10-18 12:49               ` Chris Riches
2023-10-18 13:19                 ` Rinat Gadelshin
2023-11-01  9:59             ` Chris Riches
2023-11-02  0:24               ` Paul Moore
2023-11-07 23:31             ` Paul Moore
2023-11-13  3:36               ` 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=CAHC9VhQryMhepfZwoVmb6Svs7uq9vJ-oa0S7Lc6v7jyhiGvm_g@mail.gmail.com \
    --to=paul@paul-moore.com \
    --cc=audit@vger.kernel.org \
    --cc=chris.riches@nutanix.com \
    --cc=eparis@redhat.com \
    --cc=jonathan.davies@nutanix.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).