]> git.baikalelectronics.ru Git - kernel.git/commit
audit: Syscall rules are not applied to existing processes on non-x86
authorAnton Blanchard <anton@samba.org>
Tue, 8 Jan 2013 23:46:17 +0000 (10:46 +1100)
committerEric Paris <eparis@redhat.com>
Wed, 10 Apr 2013 16:48:34 +0000 (12:48 -0400)
commit140b62fd678b3e2f034004db71d7f26eed396169
tree8ebfc70174b442a3e5585ce7cf1bc56a884e64d5
parent185045cf8af251a647ec559cc041543cd051f508
audit: Syscall rules are not applied to existing processes on non-x86

Commit bfbae5ee92f2 (audit: inline audit_syscall_entry to reduce
burden on archs) changed audit_syscall_entry to check for a dummy
context before calling __audit_syscall_entry. Unfortunately the dummy
context state is maintained in __audit_syscall_entry so once set it
never gets cleared, even if the audit rules change.

As a result, if there are no auditing rules when a process starts
then it will never be subject to any rules added later. x86 doesn't
see this because it has an assembly fast path that calls directly into
__audit_syscall_entry.

I noticed this issue when working on audit performance optimisations.
I wrote a set of simple test cases available at:

http://ozlabs.org/~anton/junkcode/audit_tests.tar.gz

02_new_rule.py fails without the patch and passes with it. The
test case clears all rules, starts a process, adds a rule then
verifies the process produces a syscall audit record.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org> # 3.3+
Signed-off-by: Eric Paris <eparis@redhat.com>
include/linux/audit.h