Re: [PATCH] audit: clear thread flag for new children

Steve Grubb
2007-11-01T18:35:34Z

On Thursday 01 November 2007 01:23:24 pm Tony Jones wrote:
> > We are looking into this - at one time it did. Someone should follow up
> > with a path correcting this soon. But I doubt the audit system will work
> > correctly if the flag gets removed as there is no good way to add it
> > again later.
>
> So on the syscall path you're now going to something like (pseudocode):
> if (unlikely(current->audit_context)) {audit_syscall_entry()}
> else if (audit_enabled) {audit_alloc(); audit_syscall_entry()}

Something like that. The TIF flag is to pick off processes that we are
interested in auditing, for performance reasons if audit is disabled the
context is not created. But if auditing is re-enabled, processes can
be "repaired" so that the are auditable again by allocating the context on
the fly the first time we see a process. Without the flag, they never get
steered into the audit system where this can happen.

> I agree, if this is what you want to do, then clearing the thread flag
> would be a bad idea.

If any other performance improvements jumps out at you, please bring them up.

> I'd assumed the current behaviour was by design as allocating contexts at
> syscall time doesn't seem a great idea but if you need the functionality,
> you need the functionality.

Yep

-Steve