public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: linux-audit@redhat.com
Subject: Re: audit_pid with multiple userspace auditd processes
Date: Wed, 07 Jan 2009 17:54:14 -0500	[thread overview]
Message-ID: <1231368854.31089.73.camel@localhost.localdomain> (raw)
In-Reply-To: <200901071741.20531.sgrubb@redhat.com>

On Wed, 2009-01-07 at 17:41 -0500, Steve Grubb wrote:
> On Wednesday 07 January 2009 04:36:39 pm Eric Paris wrote:
> > lets say userspace starts 2 copies of auditd.
> 
> # auditctl -s
> AUDIT_STATUS: enabled=1 flag=1 pid=4488 rate_limit=0 backlog_limit=512 lost=1 
> backlog=0
> # /sbin/auditd 
> # auditctl -s
> AUDIT_STATUS: enabled=1 flag=1 pid=0 rate_limit=0 backlog_limit=512 lost=1 
> backlog=0
> # ps -ef | grep auditd
> root       580     2  0 08:19 ?        00:00:00 [kauditd]
> root      4488     1  0 16:35 ?        00:00:00 auditd
> root      5128  3654  0 17:33 pts/1    00:00:00 grep auditd
> 
> 
> > Then they kill the first copy.  The kernel at that point thinks there is no
> > userspace auditd running and will instead send things to dmesg
> 
> Looks to me like the kernel is setting auditd_pid to 0 and the second auditd 
> does not start - at least with my current setup.
> 
> For some other setups, it probably overwrites the pid with the new one and 
> keeps going.
> 
> 
> > We could fix it by changing the handling in audit_receive_msg to reject
> > setting the audit_pid to 0 if the current audit_nlk_pid !=
> > NETLINK_CB(skb).pid.
> 
> Well, what if the first crashed and the kernel didn't know it yet? It might be 
> better to forcibly break the connection to the original auditd.

I'm only talking about allowing userspace to "cleanly" unset it's belief
there is an auditd out there if the message comes from that process.
We'll still handle death by means of the usual netlink socket
failures...

If auditd number 2 is the auditd the kernel knows about why should
auditd number 1 be allowed to "cleanly" say there is no auditd?

> > It's not a big deal, maybe we just call results of audit with multiple
> > userspace auditd's running at the same time a undefined and not care.
> 
> What do you get for auditctl -s before and after starting your second auditd?

[root@unused kernel-2]# auditd
[root@unused kernel-2]# auditctl -s
AUDIT_STATUS: enabled=1 flag=1 pid=752 rate_limit=0 backlog_limit=320
lost=0 backlog=0
[root@unused kernel-2]# ps -ef | grep auditd
root       752     1  0 17:48 ?        00:00:00 auditd
root       962     2  0 14:54 ?        00:00:00 [kauditd]
root      1301  2207  0 17:49 pts/0    00:00:00 grep auditd
[root@unused kernel-2]# auditd
[root@unused kernel-2]# auditctl -s
AUDIT_STATUS: enabled=1 flag=1 pid=1549 rate_limit=0 backlog_limit=320
lost=0 backlog=0
[root@unused kernel-2]# ps -ef | grep auditd
root       752     1  0 17:48 ?        00:00:00 auditd
root       962     2  0 14:54 ?        00:00:00 [kauditd]
root      1549     1  0 17:49 ?        00:00:00 auditd
root      1836  2207  0 17:49 pts/0    00:00:00 grep auditd

  reply	other threads:[~2009-01-07 22:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 21:36 audit_pid with multiple userspace auditd processes Eric Paris
2009-01-07 22:04 ` Linda Knippers
2009-01-07 22:10   ` Eric Paris
2009-01-07 22:12     ` Linda Knippers
2009-01-07 22:41 ` Steve Grubb
2009-01-07 22:54   ` Eric Paris [this message]
2009-01-07 23:07     ` Steve Grubb
2009-01-07 23:11       ` Linda Knippers
2009-01-07 23:24         ` Steve Grubb
2009-01-07 23:33           ` Linda Knippers

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=1231368854.31089.73.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=sgrubb@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