Re: [PATCHv4] random: Make /dev/random wait for input_pool initialized

2019-02-18 Thread Bernd Edlinger
> @@ -1826,7 +1830,9 @@ _random_read(int nonblock, char __user *buf, size_t > nbytes) > > nbytes = min_t(size_t, nbytes, SEC_XFER_SIZE); > while (1) { > - n = extract_entropy_user(&blocking_pool, buf, nbytes); > + n = input_pool.initialized > +

[PATCHv4] random: Make /dev/random wait for input_pool initialized

2019-02-17 Thread Bernd Edlinger
Reading from /dev/random may return data while the getrandom syscall is still blocking. Those bytes are not yet cryptographically secure. The first byte from /dev/random can have as little as 8 bits entropy estimation. Once a read blocks, it will block until /proc/sys/kernel/random/read_wakeup_t