[PATCH] audit: clear thread flag for new children

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Tony Jones
Date: Friday, October 26, 2007 - 1:42 pm

From: Tony Jones <tonyj@suse.de>

Minor performance enhancement.

Thread flag TIF_SYSCALL_AUDIT is not cleared for new children when audit 
context creation has been disabled (auditctl -e0). This can cause new children 
forked from a parent created when audit was enabled to not take the fastest 
syscall path thru entry.S

Signed-off-by: Tony Jones <tonyj@suse.de>
---
 kernel/auditsc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -814,8 +814,10 @@ int audit_alloc(struct task_struct *tsk)
 	struct audit_context *context;
 	enum audit_state     state;
 
-	if (likely(!audit_enabled))
+	if (likely(!audit_enabled)) {
+		clear_tsk_thread_flag(tsk, TIF_SYSCALL_AUDIT);
 		return 0; /* Return if not auditing. */
+	}
 
 	state = audit_filter_task(tsk);
 	if (likely(state == AUDIT_DISABLED))
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] audit: clear thread flag for new children, Tony Jones, (Fri Oct 26, 1:42 pm)
Re: [PATCH] audit: clear thread flag for new children, Chris Wright, (Fri Oct 26, 3:42 pm)
Re: [PATCH] audit: clear thread flag for new children, Steve Grubb, (Sat Oct 27, 7:21 am)
Re: [PATCH] audit: clear thread flag for new children, Tony Jones, (Mon Oct 29, 10:20 am)
Re: [PATCH] audit: clear thread flag for new children, Steve Grubb, (Mon Oct 29, 3:04 pm)
Re: [PATCH] audit: clear thread flag for new children, Steve Grubb, (Thu Nov 1, 11:34 am)