lkml.org 
[lkml]   [2022]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] init: call time_init() before rand_initialize()
Hi Andrew,

On Sat, May 07, 2022 at 12:26:53PM -0700, Andrew Morton wrote:
> On Thu, 5 May 2022 02:31:14 +0200 "Jason A. Donenfeld" <Jason@zx2c4.com> wrote:
>
> > Currently time_init() is called before rand_initialize(), but
>
> You mean "after"! Changelog was really confusing until I went and
> looked at the code.

Oh dear, yes. Will fix that.

>
> > rand_initialize() makes use of the timer on various platforms, and
> > sometimes this timer needs to be initialized by time_init() first. In
> > order to not return zero,
>
> return zero from what?

random_get_entropy_fallback(). I'll fix that in the commit message.

> > reverse the order of these two calls. The
> > block doing random initialization was right before time_init() before,
> > so changing the order shouldn't have any complicated effects.
>
> I hope you're right. Moving these things around tends to fix one thing
> and break another.

I hope so too. Reading the platform code for every arch I can't see
where breakage would be. Nothing in the time init functions relies on
the rng being available, and actually, the rng is already quasi
functional before the call to rand_initialize(), so I think it should be
good. Nonetheless:

> No probs. Plenty of testing in linux-next, please.

Exactly this. Plus the CI on build.wireguard.com and such is churning on
it on a variety of different archs.

Jason

\
 
 \ /
  Last update: 2022-05-07 23:10    [W:0.330 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site