* Chris Wright (chrisw(a)osdl.org) wrote:
+static inline int audit_alloc(struct task_struct *task) {
+ if (likely(!audit_enabled))
+ clear_tsk_thread_flag(task, TIF_SYSCALL_AUDIT);
+ return 0;
+ return do_audit_alloc(task);
or better yet, with something that will work ;-)
-chris
--
include/linux/audit.h | 11 ++++++++++-
kernel/auditsc.c | 8 +-------
2 files changed, 11 insertions(+), 8 deletions(-)
Index: linus-2.6/kernel/auditsc.c
===================================================================
--- linus-2.6.orig/kernel/auditsc.c
+++ linus-2.6/kernel/auditsc.c
@@ -47,9 +47,6 @@
*/
#define AUDIT_DEBUG 0
-/* No syscall auditing will take place unless audit_enabled != 0. */
-extern int audit_enabled;
-
/* AUDIT_NAMES is the number of slots we reserve in the audit_context
* for saving names from getname(). */
#define AUDIT_NAMES 20
@@ -601,14 +598,11 @@ static inline struct audit_context *audi
* if necessary. Doing so turns on system call auditing for the
* specified task. This is called from copy_process, so no lock is
* needed. */
-int audit_alloc(struct task_struct *tsk)
+int do_audit_alloc(struct task_struct *tsk)
{
struct audit_context *context;
enum audit_state state;
- if (likely(!audit_enabled))
- return 0; /* Return if not auditing. */
-
state = audit_filter_task(tsk);
if (likely(state == AUDIT_DISABLED))
return 0;
Index: linus-2.6/include/linux/audit.h
===================================================================
--- linus-2.6.orig/include/linux/audit.h
+++ linus-2.6/include/linux/audit.h
@@ -200,6 +200,8 @@ struct audit_buffer;
struct audit_context;
struct inode;
+extern int audit_enabled;
+
#define AUDITSC_INVALID 0
#define AUDITSC_SUCCESS 1
#define AUDITSC_FAILURE 2
@@ -207,7 +209,14 @@ struct inode;
#ifdef CONFIG_AUDITSYSCALL
/* These are defined in auditsc.c */
/* Public API */
-extern int audit_alloc(struct task_struct *task);
+extern int do_audit_alloc(struct task_struct *task);
+static inline int audit_alloc(struct task_struct *task) {
+ if (likely(!audit_enabled)) {
+ clear_tsk_thread_flag(task, TIF_SYSCALL_AUDIT);
+ return 0;
+ }
+ return do_audit_alloc(task);
+}
extern void audit_free(struct task_struct *task);
extern void audit_syscall_entry(struct task_struct *task, int arch,
int major, unsigned long a0, unsigned long a1,