Re:The getrandom(2) system call was requested by the LibreSS...
by onnoonno on Friday July 18, 2014 @04:29AM
(#8052155)
Excuse me for asking a stupid question, I am not too deep into linux kernel randomness generation:
Why is /dev/urandom spitting out anything before it has acquired enough entropy for the initial seed? Wouldn't it be a good idea for it to initially block?
Re:The getrandom(2) system call was requested by the LibreSS...
by taejo on Friday July 18, 2014 @05:06AM
(#8052216)
Yes. But it would break userspace to change it now (because some init script might block trying to read /dev/urandom)
Re:The getrandom(2) system call was requested by the LibreSS...
by bradleyjg on Friday July 18, 2014 @12:14PM
(#8053816)
The contract when /dev/random and /dev/urandom came out was that urandom would never, ever block.
On a system with a recent Intel processor, there's a instruction (RDSEED) that uses on on-die hardware RNG. I'm not familiar with the standard linux boot-up process, but it could in principle seed urandom using RDSEED arbitrarily early in the process. That should work on VMs too unless the hypervisor is blocking access (can't imagine a good reason for that).
Via has on-die RNG considerably longer, though it's accessed slightly differently. I don't believe AMD or ARM has anything similar.
Exactly. The warnings about "entropy depletion" are only relevant to theoretical attacks which require either impossibly large computational resources or a flaw in the PRNG algorithm. Since either assumption breaks all our crypto for other, unrelated reasons, we use /dev/urandom.
That, and if you use /dev/urandom before it's seeded, you expose yourself to real attacks.