lkml.org 
[lkml]   [2019]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Linux 5.3-rc8
On Mon, Sep 16, 2019 at 10:00 AM Theodore Y. Ts'o <tytso@mit.edu> wrote:
>
> How /dev/random blocks is very different from how getrandom(2) blocks.
> Getrandom(2) blocks until the CRNG, and then it never blocks again.

Yes and no.

getrandom() very much blocks exactly like /dev/random, when you give
it the GRND_RANDOM flag.

Which is completely broken, and was already known to be broken. So
that flag is just plain stupid.

And getrandom() does *not* block like /dev/urandom does (ie not at
all), which was actually useful, and very widely used.

So you really have the worst of both worlds.

Yes, getrandom(0) does what /dev/random _should_ have done, and what
getrandom(GRND_RANDOM) should be but isn't.

But by making the choice it did, we now have three useless flag
combinations, and we lack one people _want_ and need.

And this design mistake very much caused the particular bug we are now hitting.

Linus

\
 
 \ /
  Last update: 2019-09-16 19:08    [W:0.167 / U:6.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site