From: Jamie Lokier <jamie@shareable.org>
To: Ian Molton <ian.molton@collabora.co.uk>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Socket reconnection.
Date: Mon, 7 Dec 2009 02:29:34 +0000 [thread overview]
Message-ID: <20091207022934.GC1021@shareable.org> (raw)
In-Reply-To: <4B1BDCCA.5080208@collabora.co.uk>
Ian Molton wrote:
> >> Besides, not all entropy comes from /dev/random.
> >
> > On a Linux host, why isn't rngd simply injecting it's entropy into
> > /dev/random where it would be more convenient to access? (No need for
> > socket reconnection code, for example).
>
> Who knows? lack of privs, an admin who only uses egd, a machine which is
> being fed entropy by egd via a tunnel. User doesnt trust /dev/random,
> /dev/random known to be failing FIPS tests on a shared machine - there
> could be any number of reasons. In our case, entropy is comming from
> hardware via egd, to be used in the guest VMs. why feed it into RNGD,
> then the hosts entropy pool, THEN the guests - just feed them directly.
> the egd daemon in this case also offers load balancing to all consumers
> of entropy.
Those arguments are weak because they also apply the other way: an
admin who only uses /dev/random (got lots of those), a machine which
is being fed entropy into /dev/random via a tunnel (been there), user
doesn't trust egd (why should I trust it more than the kernel?
userspace is more easily corrupted - and with a socket, it might not
even be egd running), etc.
I grant you there are advantages sometimes, but also disadvantages.
Why would I run egd on a guest VM running an embedded system with 16MB
RAM, where every process is precious, for example? But those systems
need entropy too.
As for why feed it "directly" via hardware -> egd -> guest", the
reason surely is because most clients read /dev/random or
/dev/urandom, so entropy that isn't injected into /dev/random is wasted.
Anyway, I've just read the rngd manual, and it does inject it's
entropy into /dev/random so that's the end of that discussion :-)
But the main issue is below. On all host systems I have access to,
there is _no_ entropy available from egd/rngd...
> Since we need this on hosts without /dev/random anyway, I dont see why
> we would need to deliberately cripple qemu on linux hosts...
Since nobody has asked you to cripple anything, that is irrelevant.
Options don't cripple.
The lack of option is crippling qemu on linux hosts which don't run egd.
Which hosts are those? Well, I've just checked five live systems,
four servers and one laptop, running:
Ubuntu 9.10 (Karmic) - no egd running, no rngd running
Ubuntu 9.04 (Jaunty) - no egd running, no rngd running
Debian 4.0 (Etch) - no egd running, no rngd running
CentOS 4.0 - no egd running, no rngd running
RHEL 4.0 - no egd running, no rngd running
So if I understand right, the virtio-rng host driver won't work on any
host system I have access to? Is that correct?
Btw, /dev/random is available on virtually every host - Linux,
Solaris, FreeBSD, Mac OS X, NetBSD, OpenBSD, Tru64, HP-UX, AIX, and
there's even a similar device for Windows :-)
I grant you the egd/rngd entropy is preferable on a system that's
running it. It is much more careful. (Let's ignore this in rngd's
man page: "Do not do that unless you trust rngd's source of random
data"). So a good default would be to use the egd/rngd socket when
available, and fall back to /dev/random or even /dev/urandom (at user
request) when not.
My tests show that egd/rngd are not running on any host system I have
access to - and that's quite a diverse range of Linuxes. It would
have to be run specially, which sounds problematic as qemu would be
the only process using it.
-- Jamie
next prev parent reply other threads:[~2009-12-07 2:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-26 0:31 [Qemu-devel] Socket reconnection Ian Molton
2009-11-26 9:21 ` Gerd Hoffmann
2009-11-27 9:01 ` Jamie Lokier
2009-12-01 11:55 ` Ian Molton
2009-12-06 14:32 ` Jamie Lokier
2009-12-06 16:33 ` Ian Molton
2009-12-07 2:29 ` Jamie Lokier [this message]
2009-12-07 9:29 ` Ian Molton
2009-11-30 17:18 ` Anthony Liguori
2009-12-01 11:54 ` Ian Molton
2009-12-01 14:38 ` Krumme, Chris
2009-12-01 18:29 ` Ian Molton
2009-12-01 18:54 ` Anthony Liguori
2009-12-02 10:40 ` Ian Molton
2009-12-02 12:04 ` [Qemu-devel] " Jan Kiszka
2009-12-02 19:56 ` [Qemu-devel] " Anthony Liguori
2009-12-02 22:35 ` Krumme, Chris
2009-12-03 10:04 ` Ian Molton
2009-12-03 10:23 ` Kevin Wolf
2009-12-03 14:22 ` Anthony Liguori
2009-12-03 18:37 ` [Qemu-devel] [PATCH]Socket reconnection Ian Molton
2009-12-05 22:03 ` Ian Molton
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=20091207022934.GC1021@shareable.org \
--to=jamie@shareable.org \
--cc=ian.molton@collabora.co.uk \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).