diff options
author | Anton Blanchard <anton@samba.org> | 2013-01-08 18:46:17 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2013-04-10 12:48:34 -0400 |
commit | cdee3904b4ce7c03d1013ed6dd704b43ae7fc2e9 (patch) | |
tree | 8ebfc70174b442a3e5585ce7cf1bc56a884e64d5 | |
parent | 6ff5e45985c2fcb97947818f66d1eeaf9d6600b2 (diff) |
audit: Syscall rules are not applied to existing processes on non-x86
Commit b05d8447e782 (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>
-rw-r--r-- | include/linux/audit.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 5a6d718adf34..37464c592c92 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -120,7 +120,7 @@ static inline void audit_syscall_entry(int arch, int major, unsigned long a0, | |||
120 | unsigned long a1, unsigned long a2, | 120 | unsigned long a1, unsigned long a2, |
121 | unsigned long a3) | 121 | unsigned long a3) |
122 | { | 122 | { |
123 | if (unlikely(!audit_dummy_context())) | 123 | if (unlikely(current->audit_context)) |
124 | __audit_syscall_entry(arch, major, a0, a1, a2, a3); | 124 | __audit_syscall_entry(arch, major, a0, a1, a2, a3); |
125 | } | 125 | } |
126 | static inline void audit_syscall_exit(void *pt_regs) | 126 | static inline void audit_syscall_exit(void *pt_regs) |