|
|
Subscribe / Log in / New account

Fact checking

Fact checking

Posted May 30, 2014 6:50 UTC (Fri) by bnorris (subscriber, #92090)
Parent article: Who audits the audit code?

> As a result, almost all systems out there have audit enabled

$ grep CONFIG_AUDIT /boot/config-`uname -r`
CONFIG_AUDIT_ARCH=y
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y

> (look for a running kauditd thread)

None here.

> even though few of them are using it. These systems take a performance penalty just for having audit enabled, and they are vulnerable to any issues that may be found in the audit code.

I'm not an expert on the kaudit subsystem (in fact, I just learned of it), but it looks like kauditd is only spawned in response to a user-space request for it (e.g. from SELinux auditd). See kernel/audit.c:

static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
[...]
/* As soon as there's any sign of userspace auditd,
* start kauditd to talk to it */
if (!kauditd_task) {
kauditd_task = kthread_run(kauditd_thread, NULL, "kauditd");
[...]
}

So it looks like my Ubuntu system doesn't have any overhead from kauditd; just the overhead of listening (likely low?).

Now, I don't know what other kinds of overhead CONFIG_AUDIT* might have besides kauditd, but I am at least doubtful of these claims now.


to post comments

Fact checking

Posted May 30, 2014 13:03 UTC (Fri) by alonz (subscriber, #815) [Link] (1 responses)

According to the posting by Andy, the effect of CONFIG_AUDITSYSCALLS is
It forces all syscalls into the slow path and it can do crazy things
like building audit contexts just in case actual handling of the
syscall triggers an audit condition so that the exit path can log the
syscall.  That's way worse than a single branch.

Try it: benchmark getpid on Fedora and then repeat the experiment with
syscall auditing fully disabled.  The difference is striking.

Fact checking

Posted May 30, 2014 18:07 UTC (Fri) by bnorris (subscriber, #92090) [Link]

Right, I wasn't really objecting to the statement that the audit subsystem causes syscall overhead by default (I haven't run enough tests to confirm/deny). I was just objecting to the wording of this article; it points users to the 'kauditd' kernel thread, which AFAICT does not necessarily run by default. This is potentially misleading.

Fact checking

Posted May 30, 2014 17:16 UTC (Fri) by luto (guest, #39314) [Link] (7 responses)

Try running your favorite syscall-heavy workload and seeing if __audit_syscall_xyz shows up.

To be clear: I don't really object to CONFIG_AUDIT -- it's just CONFIG_AUDITSYSCALL. Once audit has been enabled, you're stuck with syscall auditing overhead until the next reboot. There's a workaround:

# auditctl -a task,never

I'm currently lobbying for Fedora to turn off syscall auditing in their default configuration:

https://fedorahosted.org/fesco/ticket/1311

Fact checking

Posted Jun 1, 2014 5:13 UTC (Sun) by dirtyepic (guest, #30178) [Link] (6 responses)

Isn't AUDITSYSCALL required for consolekit to work properly?

Fact checking

Posted Jun 1, 2014 5:21 UTC (Sun) by luto (guest, #39314) [Link]

Wow. That's hideous.

I have no clue what loginuid and sessionid (which appears to be completely unrelated to the POSIX session id) have to do with syscall auditing. It would be easy to split that out from CONFIG_AUDITSYSCALL, since it seems to be almost completely unrelated to syscall auditing, other than the fact that syscall auditing logs the loginuid and sessionid.

Fact checking

Posted Jun 3, 2014 19:48 UTC (Tue) by zdzichu (guest, #17118) [Link] (4 responses)

ConsoleKit is so dead and so irrelevant today, it's not worth a dime.

Fact checking

Posted Jun 4, 2014 4:24 UTC (Wed) by dirtyepic (guest, #30178) [Link] (3 responses)

I can't argue that, but it's disappointing. Systemd isn't really an option here (in fact it's proven impossible for us to make any kind of big change - we're still on cvs FFS).

Fact checking

Posted Jun 14, 2014 9:19 UTC (Sat) by Duncan (guest, #6647) [Link] (2 responses)

Systemd requires it too (or at least gentoo's systemd ebuild checks for it and warns if the thing isn't enabled), probably for exactly the same thing consolekit uses it for, if not more.

But no sign of kauditd. I might just try disabling CONFIG_AUDIT or at least CONFIG_AUDITSYSCALL next time I do a kernel build and see if systemd can run properly with it disabled. I've wondered why I actually needed it ever since I first enabled it. At least that way if I have to actually reenable it, I'll know exactly what I was unbreaking by doing so.

Fact checking

Posted Jun 14, 2014 13:56 UTC (Sat) by Duncan (guest, #6647) [Link] (1 responses)

Well, whatever systemd "requires" CONFIG_AUDIT for, doesn't seem to affect me turning it off. I rebuild without it, rebooted, logged in, started X... launched a terminal window and zgrepped /proc/config.gz for CONFIG_AUDIT to verify I hadn't somehow booted the old kernel... Loaded up firefox and LWN again to write this update...

Still don't know what systemd "requires" it for, but it's off now and doesn't seem to hurt me, so... I'm leaving it off.

Fact checking

Posted Jun 16, 2014 11:13 UTC (Mon) by cortana (subscriber, #24596) [Link]

It's funny because systemd's README explicitly instructs users who want to run systemd inside a container to disable the audit subsystem.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds