[PATCH] audit: use current whenever possible
Paul Moore
paul at paul-moore.com
Mon Nov 26 23:50:58 UTC 2018
On Thu, Nov 22, 2018 at 5:44 PM Richard Guy Briggs <rgb at redhat.com> wrote:
> On 2018-11-21 18:24, Paul Moore wrote:
> > There are many places, notably audit_log_task_info() and
> > audit_log_exit(), that take task_struct pointers but in reality they
> > are always working on the current task. This patch eliminates the
> > task_struct arguments and uses current directly which allows a number
> > of cleanups as well.
> >
> > Signed-off-by: Paul Moore <paul at paul-moore.com>
>
> Ack. This looks like a welcome simplification. This will cause a merge
> conflict with my ghak59 patch 4&5 (but Jan's patch didn't) which is
> fine. I'd like to rebase ghak59 on this once this is merged to get the
> EOE record in the right place after kill_trees...
Thanks for the review, I just merged it into audit/next so you should
be able to rebase your patches now.
> One minor comment in __audit_free() below once we've established tsk ==
> current...
...
> Once we've established that tsk == current, I think it would read better
> if we used current in the two filter calls and in fact simplify it even
> more and just eliminate the task_struct parameter from both audit_filter
> calls since it will only ever be current.
Yeah, I went back and forth on this too, but eventually decided to
leave this as-is for the moment - another one of those judgement
calls. In the case of the filter functions, both were pretty small
and I could *maybe* see them being useful for tasks other than current
... maybe not. We can always convert them in the future too.
--
paul moore
www.paul-moore.com
More information about the Linux-audit
mailing list