lkml.org 
[lkml]   [2022]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] timekeeping: contribute wall clock to rng on time change
Hi Eric,

On Thu, Jun 23, 2022 at 7:39 PM Eric Biggers <ebiggers@kernel.org> wrote:
> This doesn't compile:

Doh. I had the missing include, but missed it in `git add -p`. Will be
fixed for v2.

> > @@ -1346,6 +1346,9 @@ int do_settimeofday64(const struct timespec64 *ts)
> > if (!ret)
> > audit_tk_injoffset(ts_delta);
> >
> > + ktime_get_real_ts64(&xt);
> > + add_device_randomness(&xt, sizeof(xt));
> > +
> > return ret;
>
> Isn't the new time already available in 'ts'? Is the call to
> ktime_get_real_ts64() necessary?

Good point; you're right. Will simplify as such.

> > ntp_notify_cmos_timer();
> >
> > + ktime_get_real_ts64(&ts);
> > + add_device_randomness(&ts, sizeof(ts));
> > +
> > return ret;
> > }
>
> adjtimex() actually triggers a gradual adjustment of the clock, rather than
> setting it immediately. Is there a way to mix in the target time rather than
> the current time as this does?

Hmm... I have no idea. But maybe instead I can just call
`add_device_randomness()` on that big struct of offsets and things. If
the kernel is able to use it to set the time, then probably it's a
sufficient encoding of that end state.

Jason

\
 
 \ /
  Last update: 2022-06-23 21:00    [W:0.088 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site