Re: [PATCH] random: Make /dev/random wait for crng_ready

2019-02-14 Thread Bernd Edlinger
On 2/15/19 2:47 AM, Bernd Edlinger wrote: > while (1) { > - n = extract_entropy_user(_pool, buf, nbytes); > + n = crng_ready() > + ? extract_entropy_user(_pool, buf, nbytes) > + : 0; Aehm, the whitespace after ? does not align

[PATCH] random: Make /dev/random wait for crng_ready

2019-02-14 Thread Bernd Edlinger
Reading from /dev/random may return data while the getrandom syscall is still blocking. Those bytes are not yet cryptographically secure. Make read and select for reading on /dev/random wait until the crng is fully initialized. Signed-off-by: Bernd Edlinger --- drivers/char/random.c | 10