Re: get_random_bytes returns bad randomness before seeding is complete

From: Stephan Müller
Date: Sun Jun 04 2017 - 01:48:47 EST


Am Freitag, 2. Juni 2017, 16:59:56 CEST schrieb Jason A. Donenfeld:

Hi Jason,

>
> Alternatively, I'm open to other solutions people might come up with.

How about stirring in some data from the Jitter RNG that we have in the kernel
already and that is used for the DRBG in case get_random_bytes has
insufficient entropy? Yes, two kernel developers said that this RNG is
useless, where in fact a lot of hardware and even crypto folks say that this
approach has merits.

In any case, it cannot destroy the (not present) entropy at boot time anyway.
Thus, take some 32, 48 or 64 bytes from it right at the start of the kernel,
and we should be better (from the view point of quite some folks) or not worse
off (view point of two developers here).

As this RNG does not depend on any in-kernel facility, it is always available
at any time.

PS: I could revive a patch adding this to random.c that I sent long ago if
desired.

Ciao
Stephan