Skip to content

Commit

Permalink
audit_alloc: clear TIF_SYSCALL_AUDIT if !audit_context
Browse files Browse the repository at this point in the history
If audit_filter_task() nacks the new thread it makes sense
to clear TIF_SYSCALL_AUDIT which can be copied from parent
by dup_task_struct().

A wrong TIF_SYSCALL_AUDIT is not really bad but it triggers
the "slow" audit paths in entry.S to ensure the task can not
miss audit_syscall_*() calls, this is pointless if the task
has no ->audit_context.

Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Steve Grubb <[email protected]>
Acked-by: Eric Paris <[email protected]>
Signed-off-by: Richard Guy Briggs <[email protected]>
Signed-off-by: Eric Paris <[email protected]>
  • Loading branch information
oleg-nesterov authored and eparis committed Nov 5, 2013
1 parent af0e493 commit d48d805
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/auditsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,8 +943,10 @@ int audit_alloc(struct task_struct *tsk)
return 0; /* Return if not auditing. */

state = audit_filter_task(tsk, &key);
if (state == AUDIT_DISABLED)
if (state == AUDIT_DISABLED) {
clear_tsk_thread_flag(tsk, TIF_SYSCALL_AUDIT);
return 0;
}

if (!(context = audit_alloc_context(state))) {
kfree(key);
Expand Down

0 comments on commit d48d805

Please sign in to comment.