linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] Rework random blocking
@ 2019-09-20 14:36 Andy Lutomirski
  2019-09-20 14:36 ` [PATCH v2 1/7] random: Don't wake crng_init_wait when crng_init == 1 Andy Lutomirski
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Andy Lutomirski @ 2019-09-20 14:36 UTC (permalink / raw)
  To: Theodore Tso
  Cc: LKML, Linux API, Kees Cook, Jason A. Donenfeld, Ahmed S. Darwish,
	Lennart Poettering, Eric W. Biederman, Alexander E. Patrakov,
	Michael Kerrisk, Willy Tarreau, Matthew Garrett,
	Ext4 Developers List, linux-man, Andy Lutomirski

This makes two major semantic changes to Linux's random APIs:

It adds getentropy(..., GRND_INSECURE).  This causes getentropy to
always return *something*.  There is no guarantee whatsoever that
the result will be cryptographically random or even unique, but the
kernel will give the best quality random output it can.  The name is
a big hint: the resulting output is INSECURE.

The purpose of this is to allow programs that genuinely want
best-effort entropy to get it without resorting to /dev/urandom.
Plenty of programs do this because they need to do *something*
during boot and they can't afford to wait.  Calling it "INSECURE" is
probably the best we can do to discourage using this API for things
that need security.

This series also removes the blocking pool and makes /dev/random
work just like getentropy(..., 0) and makes GRND_RANDOM a no-op.  I
believe that Linux's blocking pool has outlived its usefulness.
Linux's CRNG generates output that is good enough to use even for
key generation.  The blocking pool is not stronger in any material
way, and keeping it around requires a lot of infrastructure of
dubious value.

This series should not break any existing programs.  /dev/urandom is
unchanged.  /dev/random will still block just after booting, but it
will block less than it used to.  getentropy() with existing flags
will return output that is, for practical purposes, just as strong
as before.

Changes from v1:
 - Rebased to v5.3.  No other changes.

Andy Lutomirski (7):
  random: Don't wake crng_init_wait when crng_init == 1
  random: Add GRND_INSECURE to return best-effort non-cryptographic
    bytes
  random: Ignore GRND_RANDOM in getentropy(2)
  random: Make /dev/random be almost like /dev/urandom
  random: Remove the blocking pool
  random: Delete code to pull data into pools
  random: Remove kernel.random.read_wakeup_threshold

 drivers/char/random.c       | 234 ++++--------------------------------
 include/uapi/linux/random.h |   4 +-
 2 files changed, 27 insertions(+), 211 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-09-26  1:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 14:36 [PATCH v2 0/7] Rework random blocking Andy Lutomirski
2019-09-20 14:36 ` [PATCH v2 1/7] random: Don't wake crng_init_wait when crng_init == 1 Andy Lutomirski
2019-09-20 14:36 ` [PATCH v2 2/7] random: Add GRND_INSECURE to return best-effort non-cryptographic bytes Andy Lutomirski
2019-09-20 14:36 ` [PATCH v2 3/7] random: Ignore GRND_RANDOM in getentropy(2) Andy Lutomirski
2019-09-20 14:36 ` [PATCH v2 4/7] random: Make /dev/random be almost like /dev/urandom Andy Lutomirski
2019-09-20 14:36 ` [PATCH v2 5/7] random: Remove the blocking pool Andy Lutomirski
2019-09-20 14:36 ` [PATCH v2 6/7] random: Delete code to pull data into pools Andy Lutomirski
2019-09-20 14:36 ` [PATCH v2 7/7] random: Remove kernel.random.read_wakeup_threshold Andy Lutomirski
2019-09-24 20:30   ` Jann Horn
2019-09-26  1:09     ` Eric W. Biederman
2019-09-20 14:46 ` [PATCH v2 0/7] Rework random blocking Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).