From: Paul Moore <pmoore@redhat.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: Richard Guy Briggs <rgb@redhat.com>,
linux-audit@redhat.com, linux-kernel@vger.kernel.org,
eparis@redhat.com, v.rathor@gmail.com, ctcard@hotmail.com
Subject: Re: [PATCH V2 1/2] audit: stop an old auditd being starved out by a new auditd
Date: Mon, 21 Dec 2015 17:36:46 -0500 [thread overview]
Message-ID: <3244624.KajibWDVmd@sifl> (raw)
In-Reply-To: <3132444.Y0z3o3Cmva@x2>
On Monday, December 21, 2015 05:18:15 PM Steve Grubb wrote:
> On Monday, December 21, 2015 04:48:00 PM Paul Moore wrote:
> > On Wednesday, December 16, 2015 11:23:19 AM Steve Grubb wrote:
> > > On Wednesday, December 16, 2015 10:42:32 AM Richard Guy Briggs wrote:
> > > > Nothing prevents a new auditd starting up and replacing a valid
> > > > audit_pid when an old auditd is still running, effectively starving
> > > > out the old auditd since audit_pid no longer points to the old valid
> > > > auditd.
> > >
> > > I guess the first question is why do we allow something to start up a
> > > new auditd without killing off the old one? Would that be a simpler
> > > fix?
> >
> > I imagine there might be scenarios where you need to forcibly kill an
> > instance of auditd such that things might not get fully cleaned up in the
> > kernel, audit_{pid,sock,etc.}.
>
> But the first time an event is sent and auditd doesn't exist, it resets the
> audit_pid to 0.
>
> static void kauditd_send_skb(struct sk_buff *skb)
> {
> int err;
> /* take a reference in case we can't send it and we want...
> skb_get(skb);
> err = netlink_unicast(audit_sock, skb, audit_nlk_portid, 0);
> if (err < 0) {
> BUG_ON(err != -ECONNREFUSED); /* Shouldn't happen */
> if (audit_pid) {
> pr_err("*NO* daemon at audit_pid=%d\n", audit_pid);
> audit_log_lost("auditd disappeared");
> audit_pid = 0;
> audit_sock = NULL;
> }
As an aside, it doesn't matter in this particular case, but the above code is
not current. Please try to use either what is in Linus' tree or audit#next
when pasting code snippets; it's less confusing.
I still think there is some value in having the ability for an admin to reset
the kernel's auditd tracking manually as relying on an event to be emitted
does not seem like a solution I would want to have to justify. Although I do
admit that for most systems this shouldn't be a problem as events should
likely occur often enough.
There really is no harm in merging these patches, and they do provide some,
admittedly small, value.
> > Keeping the ability to reset the kernel's auditd state, even when the
> > kernel *thinks* auditd is still alive might be a nice thing to keep
> > around for a while longer.
>
> I'm just thinking its rare that anyone would try to steal away the audit
> socket. Its more work for everyone to create a new event and send it than to
> just not allow it. you can even force an event with "auditctl -m test"
> which should reset the pid if the kernel was out of sync.
I do not want to disallow starting an new instance of auditd, so this patchset
looks reasonable to me.
--
paul moore
security @ redhat
prev parent reply other threads:[~2015-12-21 22:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 15:42 [PATCH V2 1/2] audit: stop an old auditd being starved out by a new auditd Richard Guy Briggs
2015-12-16 15:42 ` [PATCH V2 2/2] audit: log failed attempts to change audit_pid configuration Richard Guy Briggs
2015-12-16 16:23 ` [PATCH V2 1/2] audit: stop an old auditd being starved out by a new auditd Steve Grubb
2015-12-21 21:48 ` Paul Moore
2015-12-21 22:18 ` Steve Grubb
2015-12-21 22: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=3244624.KajibWDVmd@sifl \
--to=pmoore@redhat.com \
--cc=ctcard@hotmail.com \
--cc=eparis@redhat.com \
--cc=linux-audit@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rgb@redhat.com \
--cc=sgrubb@redhat.com \
--cc=v.rathor@gmail.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;
as well as URLs for NNTP newsgroup(s).