On Thu, 2010-08-26 at 13:34 +1000, Anton Blanchard wrote:
Hi Eric,
Here's another approach Mikey and I were discussing. We allocate the
tsk->audit_context as before, but we avoid setting the TIF_SYSCALL_AUDIT until
the first rule gets added.
We could look at clearing the flag when the rules go back to zero, but this
simple patch covers the most common case I think.
It just dawned on me where we are going to have problems. We have
things other than syscall filter rules that can cause us to want the
collected audit info. Namely SELinux (or other LSM) denials.
Crap.
So the change in audit_alloc() should probably be conditionalized on
more than just audit_n_rules(). Not exactly sure what that is though.
It might also make our syscall entry/exit speedups not as great of an
idea as I thought. I need to look for other audit users to see how
these things are oging to affect them :(
-Eric