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
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
2 matches
Mail list logo