Re: [RFC PATCH ghak10 v6 1/2] timekeeping: Audit clock adjustments

From: Thomas Gleixner
Date: Tue Apr 02 2019 - 05:06:54 EST


On Mon, 1 Apr 2019, Ondrej Mosnacek wrote:
> On Thu, Mar 28, 2019 at 1:09 AM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> > > EXPORT_SYMBOL(do_settimeofday64);
> > > @@ -2322,6 +2326,8 @@ int do_adjtimex(struct timex *txc)
> > > ret = timekeeping_inject_offset(&delta);
> > > if (ret)
> > > return ret;
> > > +
> > > + audit_tk_injoffset(delta);
> > > }
> > >
> > > ktime_get_real_ts64(&ts);
> >
> > This can be done at the end of do_adjtimex() quite nicely in preemptible
> > context.
>
> But wait, isn't this call outside of the critical section as well? (I
> must have been moving the call around when I was writing the code and
> didn't realize that this function actually doesn't need GFP_ATOMIC at
> all...) Or am I missing something?

Nah. I was misreading it. Just it does not need GFP_ATOMIC at all. But then
you might just combine it with your new struct storage which you want to do
for __do_adjtimex() anyway.

Thanks,

tglx