Re: Antw: Re: [kernel-hardening] Re: [PATCH v4 06/13] iscsi: ensure RNG is seeded before use
From: Theodore Ts'o
Date: Wed Jul 05 2017 - 08:35:52 EST
On Wed, Jul 05, 2017 at 09:03:43AM +0200, Ulrich Windl wrote:
> > Note, during the development of my /dev/random implementation, I added the
> > getrandom-like blocking behavior to /dev/urandom (which is the equivalent to
> > Jason's patch except that it applies to user space). The boot process locked
> I thought reads from urandom never block by definition. An older manual page
> (man urandom) also says: "A read from the /dev/urandom device will not
> block waiting for more entropy."
As I said in my original message, I *tried* this as an experiment.
Because lots of security-obsessed people were disputing my
intelligence, my judgement, and in some cases, my paternity becuase I
wouldn't change /dev/urandom not to block.
So I did the experiment so I could give them hard data about why we
couldn't go down that path.
> > up since systemd wanted data from /dev/urandom while it processed the
> > initramfs. As it did not get any, the boot process did not commence that
> > could
> > deliver new events to be picked up by the RNG.
And indeed, making this change brick'ed at least one version of Ubuntu
and one version of CeroWRT, as reported by the kernel's 0-day testing
system. As a result, this patch (which was always a proof of concept,
not anything I thought had any chance of going upstream), was dropped.
Since in the kernel, We Do Not Break Backwards Compatibility, this is
why we have a new interface --- getrandom(2) --- instead of changing
an existing interface. (Well, there were multiple good reasons for
getrandom, but this was definitely one of them.)