From: Amit Shah <amit.shah@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Ted Ts'o <tytso@mit.edu>,
Dustin Kirkland <kirkland@canonical.com>,
qemu-devel@nongnu.org, George Wilson <gcwilson@us.ibm.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Kent Yoder <key@linux.vnet.ibm.com>,
Andreas Faerber <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 0/6] add paravirtualization hwrng support
Date: Mon, 29 Oct 2012 11:53:35 +0530 [thread overview]
Message-ID: <20121029062308.GA3564@amit.redhat.com> (raw)
In-Reply-To: <87r4ol2it5.fsf@codemonkey.ws>
On (Fri) 26 Oct 2012 [13:24:06], Anthony Liguori wrote:
> "H. Peter Anvin" <hpa@zytor.com> writes:
>
> > On 10/26/2012 08:42 AM, Anthony Liguori wrote:
> >>>
> >>> Is /dev/random even appropriate to feed rngd?
> >>>
> >>> rngd needs _a lot_ of entropy to even start working. Its randomness
> >>> test works in groups of 20000 bits. On a system without an hardware
> >>> RNG, /dev/random can hardly produce 4000 bits/minute. This means a
> >>> guest will not get any entropy boost for 5 minutes after it's started,
> >>> even if we allow it to exhaust the parent's entropy.
> >>
> >> I don't know, but rng-random is a non-blocking backend so it can handle
> >> /dev/random, /dev/urandom, or /dev/hwrng.
> >>
> >
> > /dev/urandom is just plain *wrong*... it is feeding a PRNG into a PRNG
> > which can best be described as "masturbation" and at worst as a
> > "cryptographic usage violation."
>
> I don't understand your logic here.
>
> From the discussions I've had, the quality of the randomness from a
> *well seeded* PRNG ought to be good enough to act as an entropy source
> within the guest.
>
> What qualifies as well seeded is a bit difficult to pin down with more
> specificity than "kilobytes of data".
>
> I stayed away from /dev/urandom primarily because it's impossible to
> determine if it's well seeded or not making urandom dangerous to use.
>
> But using a PRNG makes sense to me when dealing with multiple guests.
> If you have a finite source of entropy in the host, using a PRNG to
> create unique entropy for each guest is certainly better than
> duplicating entropy.
One solution could be to feed host's /dev/urandom to readers of
guests' /dev/urandom. We could then pass the rare true entropy bits
from host's /dev/hwrng or /dev/random to the guest via
virtio-rng-pci's /dev/hwrng interface in the guest.
If this is a valid idea (host /dev/urandom goes directly to guest's
/dev/urandom), we would need some guest-side surgery, but it shouldn't
be huge work, and would remove several bottlenecks.
Is this a very crazy idea?
Amit
next prev parent reply other threads:[~2012-10-29 6:23 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-26 14:43 [Qemu-devel] [PATCH 0/6] add paravirtualization hwrng support Anthony Liguori
2012-10-26 14:43 ` [Qemu-devel] [PATCH 1/6] vl: add -object option to create QOM objects from the command line Anthony Liguori
2012-10-26 14:43 ` [Qemu-devel] [PATCH 2/6] object: add object_property_add_bool (v2) Anthony Liguori
2012-10-26 14:43 ` [Qemu-devel] [PATCH 3/6] rng: add RndBackend abstract object class Anthony Liguori
2012-10-26 14:43 ` [Qemu-devel] [PATCH 4/6] rng-random: add an RNG backend that uses /dev/random Anthony Liguori
2012-10-26 14:43 ` [Qemu-devel] [PATCH 5/6] rng-egd: introduce EGD compliant RNG backend Anthony Liguori
2012-10-26 14:43 ` [Qemu-devel] [PATCH 6/6] virtio-rng: hardware random number generator device Anthony Liguori
2012-10-26 15:08 ` [Qemu-devel] [PATCH 0/6] add paravirtualization hwrng support Paolo Bonzini
2012-10-26 15:42 ` Anthony Liguori
2012-10-26 16:09 ` H. Peter Anvin
2012-10-26 18:24 ` Anthony Liguori
2012-10-26 18:26 ` H. Peter Anvin
2012-10-29 6:23 ` Amit Shah [this message]
2012-10-30 4:32 ` H. Peter Anvin
2012-10-26 18:58 ` Paolo Bonzini
2012-10-26 19:07 ` H. Peter Anvin
2012-10-26 19:51 ` Paolo Bonzini
2012-10-26 19:54 ` H. Peter Anvin
2012-10-26 20:29 ` H. Peter Anvin
2012-10-29 8:45 ` Paolo Bonzini
2012-10-30 4:34 ` H. Peter Anvin
2012-10-30 4:43 ` H. Peter Anvin
2012-10-30 9:05 ` Paolo Bonzini
2012-10-30 21:11 ` H. Peter Anvin
2012-10-31 7:29 ` Paolo Bonzini
2012-10-31 14:15 ` H. Peter Anvin
2012-10-31 14:27 ` Paolo Bonzini
2012-10-26 18:53 ` Paolo Bonzini
2012-10-29 7:01 ` Amit Shah
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=20121029062308.GA3564@amit.redhat.com \
--to=amit.shah@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=gcwilson@us.ibm.com \
--cc=hpa@zytor.com \
--cc=key@linux.vnet.ibm.com \
--cc=kirkland@canonical.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).