Earlier quoted context omitted.
/dev/random kinda does but a lot of applications also rely on /dev/urandom which doesn't, which is why it's a problem to some extend. Atleast from what I know.
I don't understand why it's not possible to make /dev/random block until there is enough entropy in the pool for the seed, and never block afterwards when it can securely do key-stretching. After seeding, there is no point in blocking on a lack of entropy, which is why it is recommended to use /dev/urandom in the first place.
Linux RNG flaws
61–67 of 67 posts
Re: Linux RNG flaws
#62Earlier quoted context omitted.
If you have network access early enough in the install and/or boot processes could you not pluck some random bits from a web service to pump more entropy into the RNG's pool? For paranoia you could host your own fairly easily instead of using a public one: have a machine that is publicly visible respond with random digits from its own entropy pool, have it use one or more of various methods to keep that pool topped u…
http://manpages.ubuntu.com/manpages/trusty/man1/pollinate.1....
Re: Linux RNG flaws
#63man urandom > When read during early boot time, /dev/urandom may return data prior to the entropy pool being initialized. I see no bugs here. Just repeating what is written in the man page.
If you continue to the next sentence in that man page: > If this is of concern in your application, use getrandom(2) or /dev/random instead. These bugs affect getrandom too.
Re: Linux RNG flaws
#64Nice.
Re: Linux RNG flaws
#65Earlier quoted context omitted.
/dev/random kinda does but a lot of applications also rely on /dev/urandom which doesn't, which is why it's a problem to some extend. Atleast from what I know.
I don't understand why it's not possible to make /dev/random block until there is enough entropy in the pool for the seed, and never block afterwards when it can securely do key-stretching. After seeding, there is no point in blocking on a lack of entropy, which is why it is recommended to use /dev/urandom in the first place.
Re: Linux RNG flaws
#66Earlier quoted context omitted.
If you continue to the next sentence in that man page: > If this is of concern in your application, use getrandom(2) or /dev/random instead. These bugs affect getrandom too.
Where is it written? Could you pin point it? I see urandom everywhere.
> Multiple callers, including sys_getrandom(..., flags=0), attempt to wait for the
> RNG to become cryptographically safe before reading from it by checking for
> crng_ready() and waiting if necessary. However, crng_ready() only checks for
> `crng_init > 0`, and `crng_init==1` does not imply that the RNG is
> cryptographically safe.
Re: Linux RNG flaws
#67Earlier quoted context omitted.
This is what getrandom(2) does, and using getrandom is the recommended path. However, if you use getrandom(2), and you are in early boot, such as by systemd's journald, and you are using it for some pointless HMAC mechanism with a randomly generated key for no specified security goal and no clearly articulated threat model, then you can end up hanging the boot, leading to the entropy deadlock situation I described. S…
Is there a way to review the different paths and come up with answers for all of them? E.g., if on a platform with a hardware RNG then it should never be necessary to block: just read 128 bits out of the hardware RNG & generate a stream of random numbers. On a platform without a hardware RNG, could one require a previous seed? An installer could install the seed in some persistent storage somewhere, so there's no nee…
Requiring a previous seed requires a way to get access to the seed, early enough in the boot that it is available to kernel users who are trying to use randomness for address space randomization and for stack canaries. But in early boot the kernel may not be sufficiently initialized to read from persistent storage, and there are many, many bootloaders.
The reason why there is no file system interface to getrandom(2) is that a file system interface is subject to file descriptor exhaustion attacks. It was OpenBSD which designed the getentropy(2) system call, and getrandom(2) was modelled after it. Basically, getrandom(2) is getentropy(2) with an extra flags parameter added.