All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: Laurent Bigonville <bigon@debian.org>
Cc: linux-audit@redhat.com
Subject: Re: Crash when loading the rules
Date: Wed, 06 Jul 2016 12:23:23 -0400	[thread overview]
Message-ID: <2000467.RyrGO56dad@x2> (raw)
In-Reply-To: <247821ed-2bec-925a-cf1b-f9f4b60fb2ba@debian.org>

On Wednesday, July 6, 2016 5:26:44 PM EDT Laurent Bigonville wrote:
Hello,

> Le 06/07/16 à 17:23, Steve Grubb a écrit :
> > On Wednesday, July 6, 2016 4:49:58 PM EDT Laurent Bigonville wrote:
> >> With 2.6.3, when loading the rules, it's crashing and I get the
> >> following backtrace:
> >> 
> >> #0  0x00007ffff687e99d in writev () at
> >> ../sysdeps/unix/syscall-template.S:84 #1  0x00005555555610ab in
> >> dispatch_event (rep=<optimized out>, is_err=0) at
> >> ../../../src/auditd-dispatch.c:189
> >> #2  0x000055555555a700 in distribute_event (e=0x555555779d80) at
> >> ../../../src/auditd.c:216
> >> #3  0x000055555555aac8 in netlink_handler (loop=<optimized out>,
> >> io=<optimized out>, revents=<optimized out>) at ../../../src/auditd.c:500
>
> > By any chance does syslog show that the dispatcher exited due to no active
> > plugins?
> 
> This is what I see in syslog:
> 
> Jul  6 17:25:15 valinor systemd[1]: Starting Security Auditing Service...
> Jul  6 17:25:15 valinor auditd[604]: Started dispatcher: /sbin/audispd
> pid: 608
> Jul  6 17:25:15 valinor audispd: priority_boost_parser called with: 4
> Jul  6 17:25:15 valinor audispd: max_restarts_parser called with: 10
> Jul  6 17:25:15 valinor audispd: No plugins found, exiting

OK. When this happens we should get a SIGCHLD which causes the handler to mark 
the writev pipe descriptor as -1. This is checked for on the way to the 
writev. So, maybe there is a race where the descriptor was ok at entry but the 
child process was gone at writev time. This should have resulted in a SIGPIPE 
when does not core dump but does terminate auditd. This can and should be 
fixed.

However, you are getting a core dump. The only thing I can think of is if 
vec[1].iov_base was assigned an invalid address. I tested this and I get 

writev(6, [{"\1\0\0\0\20\0\0\0j\4\0\0\377\0\0\0", 16}, {NULL, 255}], 2) = -1 
EFAULT (Bad address)

which also does not core dump. So, I'm note sure why you are getting a core 
dump. If this is reproducible it might be good to get an strace to see what is 
being handed to writev. Or maybe try it from valgrind to see if that gives 
additional information.

-Steve

> Jul  6 17:25:16 valinor kernel: [20575.773688] audit: netlink_unicast
> sending to audit_pid=604 returned error: -111
> Jul  6 17:25:16 valinor systemd[1]: auditd.service: Main process exited,
> code=dumped, status=11/SEGV
> Jul  6 17:25:16 valinor systemd[1]: auditd.service: Unit entered failed
> state.
> Jul  6 17:25:16 valinor systemd[1]: auditd.service: Failed with result
> 'core-dump'.

  reply	other threads:[~2016-07-06 16:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 14:49 Crash when loading the rules Laurent Bigonville
2016-07-06 15:23 ` Steve Grubb
2016-07-06 15:26   ` Laurent Bigonville
2016-07-06 16:23     ` Steve Grubb [this message]
     [not found]       ` <4b9c1eed-c988-9ee8-3326-2d6957be3e6d@debian.org>
2016-07-06 18:13         ` Steve Grubb
2016-07-07  9:35           ` Laurent Bigonville

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=2000467.RyrGO56dad@x2 \
    --to=sgrubb@redhat.com \
    --cc=bigon@debian.org \
    --cc=linux-audit@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 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.