From: Eric Paris <eparis@redhat.com>
To: Mateusz Guzik <mguzik@redhat.com>
Cc: rgb@redhat.com, linux-audit@redhat.com
Subject: Re: proposing [PATCH] audit: get rid of *NO* daemon at audit_pid=0 message
Date: Mon, 11 Nov 2013 12:21:33 -0500 [thread overview]
Message-ID: <1384190493.2938.58.camel@localhost> (raw)
In-Reply-To: <20131029230500.GC15011@mguzik.redhat.com>
On Wed, 2013-10-30 at 00:05 +0100, Mateusz Guzik wrote:
> Hello,
>
> I wrote a trivial patch for what I believe is a subsystem you maintain.
>
> I'm sending it privately first to ensure it looks ok at has proper
> recipients (I'm new to linux world, sorry :>).
>
> 'To' would be: linux-audit@redhat.com
>
> The rest is:
>
> From: Mateusz Guzik <mguzik@redhat.com>
> Date: Tue, 29 Oct 2013 23:51:52 +0100
> Subject: [PATCH] audit: get rid of *NO* daemon at audit_pid=0 message
>
> kauditd_send_skb is called after audit_pid was checked to be non-zero.
>
> However, it can be set to 0 due to auditd exiting while kauditd_send_skb
> is still executed and this can result in a spurious warning about missing
> auditd.
>
> Re-check audit_pid before printing the message.
>
> Signed-off-by: Mateusz Guzik <mguzik@redhat.com>
> Cc: Eric Paris <eparis@redhat.com>
> Cc: linux-kernel@vger.kernel.org
Acked-by: Eric Paris <eparis@redhat.com>
> ---
> kernel/audit.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/audit.c b/kernel/audit.c
> index 7b0e23a..a91a965 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -388,9 +388,11 @@ static void kauditd_send_skb(struct sk_buff *skb)
> err = netlink_unicast(audit_sock, skb, audit_nlk_portid, 0);
> if (err < 0) {
> BUG_ON(err != -ECONNREFUSED); /* Shouldn't happen */
> - printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid);
> - audit_log_lost("auditd disappeared\n");
> - audit_pid = 0;
> + if (audit_pid) {
> + printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid);
> + audit_log_lost("auditd disappeared\n");
> + audit_pid = 0;
> + }
> /* we might get lucky and get this in the next auditd */
> audit_hold_skb(skb);
> } else
> --
> 1.8.3.1
>
> Is this ok?
>
> Thanks,
next parent reply other threads:[~2013-11-11 17:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20131029230500.GC15011@mguzik.redhat.com>
2013-11-11 17:21 ` Eric Paris [this message]
2013-11-11 18:56 ` proposing [PATCH] audit: get rid of *NO* daemon at audit_pid=0 message Richard Guy Briggs
2013-11-11 19:20 ` Steve Grubb
2013-11-11 19:28 ` 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=1384190493.2938.58.camel@localhost \
--to=eparis@redhat.com \
--cc=linux-audit@redhat.com \
--cc=mguzik@redhat.com \
--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