From: Stephan Mueller <smueller@chronox.de>
To: Ted Tso <tytso@mit.edu>
Cc: linux-kernel@vger.kernel.org
Subject: why getrandom blocking does not work with /dev/urandom
Date: Sat, 22 Oct 2016 05:43:36 +0200 [thread overview]
Message-ID: <13074229.arz8HkBRPc@positron.chronox.de> (raw)
Hi Ted,
as mentioned, I looked a bit deeper into the issue of adding the blocking
behavior of getrandom to /dev/urandom.
As you and I already identified, moving that blocking behavior to /dev/urandom
simply does not work. The system does not boot.
The reason to this issue is actually quite simple. The init process of systemd
reads /dev/urandom for whatever purpose. Now, when /dev/urandom blocks during
boot, systemd will be blocked too. That means that user space (either in the
initramfs or with the regular root partition) is set up.
When there is no user space initialized, there are no devices set up. The
network card is not initialized, the block devices are not mounted, other
devices are not initialized. That means that neither interrupts nor block
device events are registered.
The only device that does not need setup and that will generate events is a
keyboard / mouse whose drivers are statically compiled (or other devices that
trigger interrupts without requiring any user space setup procedure). Thus, if
you use HID long enough, the kernel will eventually receive sufficient entropy
from these events, release systemd and user space starts.
However, just by itself, user space will almost never start with a blocking
behavior of /dev/urandom.
Ciao
Stephan
next reply other threads:[~2016-10-22 3:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-22 3:43 Stephan Mueller [this message]
2016-10-22 5:10 ` Theodore Ts'o
2016-10-23 14:09 ` Stephan Mueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13074229.arz8HkBRPc@positron.chronox.de \
--to=smueller@chronox.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®