Re: [PATCH 1/5] random: fix crng_ready() test

From: Geert Uytterhoeven
Date: Wed May 02 2018 - 12:18:21 EST


Hi Ted,

On Fri, Apr 13, 2018 at 3:30 AM, Theodore Ts'o <tytso@xxxxxxx> wrote:
> The crng_init variable has three states:
>
> 0: The CRNG is not initialized at all
> 1: The CRNG has a small amount of entropy, hopefully good enough for
> early-boot, non-cryptographical use cases
> 2: The CRNG is fully initialized and we are sure it is safe for
> cryptographic use cases.
>
> The crng_ready() function should only return true once we are in the
> last state.
>
> Reported-by: Jann Horn <jannh@xxxxxxxxxx>
> Fixes: e192be9d9a30 ("random: replace non-blocking pool...")
> Cc: stable@xxxxxxxxxx # 4.8+
> Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
> Reviewed-by: Jann Horn <jannh@xxxxxxxxxx>

Since commit 43838a23a05fbd13 ("random: fix crng_ready() test"),
all (few) remaining users of %p are printing too early, leading to "(ptrval)"
strings instead of actual hashed pointer values.

Sample timings on two platforms (arm / arm64) booting with lots of
debug ingo:

[ 28.521158] random: crng init done
[ 17.792705] random: crng init done

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds