diff options
author | Eric Paris <eparis@redhat.com> | 2012-01-03 14:23:06 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-17 16:16:56 -0500 |
commit | b05d8447e7821695bc2fa3359431f7a664232743 (patch) | |
tree | da90e558279c6407aa2e08d36bea5d9a21cd959c /include | |
parent | f031cd25568a390dc2c9c3a4015054183753449a (diff) |
audit: inline audit_syscall_entry to reduce burden on archs
Every arch calls:
if (unlikely(current->audit_context))
audit_syscall_entry()
which requires knowledge about audit (the existance of audit_context) in
the arch code. Just do it all in static inline in audit.h so that arch's
can remain blissfully ignorant.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/audit.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 3d65e4b3ba06..f56ce2669b83 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -418,9 +418,9 @@ extern int audit_classify_arch(int arch); | |||
418 | extern void audit_finish_fork(struct task_struct *child); | 418 | extern void audit_finish_fork(struct task_struct *child); |
419 | extern int audit_alloc(struct task_struct *task); | 419 | extern int audit_alloc(struct task_struct *task); |
420 | extern void audit_free(struct task_struct *task); | 420 | extern void audit_free(struct task_struct *task); |
421 | extern void audit_syscall_entry(int arch, | 421 | extern void __audit_syscall_entry(int arch, |
422 | int major, unsigned long a0, unsigned long a1, | 422 | int major, unsigned long a0, unsigned long a1, |
423 | unsigned long a2, unsigned long a3); | 423 | unsigned long a2, unsigned long a3); |
424 | extern void __audit_syscall_exit(int ret_success, long ret_value); | 424 | extern void __audit_syscall_exit(int ret_success, long ret_value); |
425 | extern void __audit_getname(const char *name); | 425 | extern void __audit_getname(const char *name); |
426 | extern void audit_putname(const char *name); | 426 | extern void audit_putname(const char *name); |
@@ -435,6 +435,13 @@ static inline int audit_dummy_context(void) | |||
435 | void *p = current->audit_context; | 435 | void *p = current->audit_context; |
436 | return !p || *(int *)p; | 436 | return !p || *(int *)p; |
437 | } | 437 | } |
438 | static inline void audit_syscall_entry(int arch, int major, unsigned long a0, | ||
439 | unsigned long a1, unsigned long a2, | ||
440 | unsigned long a3) | ||
441 | { | ||
442 | if (unlikely(!audit_dummy_context())) | ||
443 | __audit_syscall_entry(arch, major, a0, a1, a2, a3); | ||
444 | } | ||
438 | static inline void audit_syscall_exit(void *pt_regs) | 445 | static inline void audit_syscall_exit(void *pt_regs) |
439 | { | 446 | { |
440 | if (unlikely(current->audit_context)) { | 447 | if (unlikely(current->audit_context)) { |