random: block in /dev/urandom

The last time this was attempted, in 6f98a4bfee72 ("random: block in
/dev/urandom"), we had to revert, because the Linus Jitter Dance didn't
work on a few platforms that were actively getting new kernels with
broken userspaces. This has now changed, on several fronts:

- Platforms without cycle counters now fall back to the highest
  resolution clock that the platform has to offer.
- The jitter algorithm now attempts to take more samples on platforms
  with slower counters, measuring dynamically at runtime.
- Many userspaces have now been fixed (by way of my SeedRNG project),
  which doesn't account for old userspaces of course, but the odd
  architectures that are getting new userspaces and new kernels (which
  seems to mostly be QEMU test harnesses) now won't even need jitter
  entropy at all.

The first two reasons make this attempt a much more sure bet than the
last one -- since broken userspaces now shouldn't be impacted by it --
while the last reason is just a general positive ecosystem improvement.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
3 files changed