From: "H. Peter Anvin" <hpa@zytor.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Amit Shah <amit.shah@redhat.com>, qemu list <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v3 0/1] virtio-rng: hardware random number generator
Date: Sun, 16 Sep 2012 16:36:53 -0700 [thread overview]
Message-ID: <50566295.8020604@zytor.com> (raw)
In-Reply-To: <871ui1pn6o.fsf@codemonkey.ws>
On 09/16/2012 04:23 PM, Anthony Liguori wrote:
> This is *exactly* what the problem is.
>
> If using /dev/urandom is pointless--and so far, many people have made
> compelling arguments that it is--then using /dev/random is seemingly
> impossible to do fairly.
It is not merely pointless, it is a security hole.
> The virtio-rng interface doesn't have any notion of guarantee of entropy
> availability. The guest just keeps requesting entropy with no
> indication to the hypervisor of what it should and shouldn't give.
With the latest fixes to rngd this is no longer true. This *was* a bug
in rngd < 4; it would always claim to be entropy-starved (and so a guest
running rngd < 4 will have this pathology, but no distro is known to run
rngd < 4 by default due to a number of other problems with these
versions of rngd). This has been fixed. If that backpressure isn't
propagated through the virtio-rng driver then that does need to be
fixed, but from at least a cursory look I think it does.
> Since /dev/random is a finite pool, it's quite possible that one guest
> could quickly exhaust /dev/random for all other guests. How is this not
> a clear denial of service?
Well, by that definition the fact that the service hasn't been provided
at all until now is a bigger denial of service...
> This is why supporting EGD is so important IMHO. Something else needs
> to deal with handing out entropy in a responsible way.
No, you're missing the key point. Fixing this in applications (and from
the host kernel's perspective, this is an application) is broken,
because it is not just Qemu that has that property. If this is an
actual problem (and it's not clear to me that it is in anything but
theory, because although the kernel doesn't do round robin it will at
least provide amount of stochastic fairness) then it is in the kernel
that the fix belongs.
Throwing an extra daemon -- one which doesn't even claim to be designed
for this purpose -- into the middle is just silly. Either which way, it
can easily be handled via a sane fairness daemon which doesn't need a
complicated protocol.
> Anyway, this is on my list for 1.3. The series just needs some light
> dusting before resubmission.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
next prev parent reply other threads:[~2012-09-16 23:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 6:59 [Qemu-devel] [PATCH v3 0/1] virtio-rng: hardware random number generator Amit Shah
2012-06-20 6:59 ` [Qemu-devel] [PATCH v3 1/1] virtio-rng: hardware random number generator device Amit Shah
2012-06-20 8:36 ` Daniel P. Berrange
2012-06-20 21:29 ` Anthony Liguori
2012-06-22 11:06 ` Amit Shah
2012-07-02 17:56 ` Stefan Berger
2012-06-22 12:12 ` Markus Armbruster
2012-06-22 12:22 ` Anthony Liguori
2012-06-22 12:31 ` Daniel P. Berrange
2012-06-22 12:58 ` Anthony Liguori
2012-06-22 13:34 ` Daniel P. Berrange
2012-06-22 13:44 ` Anthony Liguori
2012-06-22 18:50 ` Amit Shah
2012-06-22 19:59 ` Anthony Liguori
2012-09-16 20:42 ` [Qemu-devel] [PATCH v3 0/1] virtio-rng: hardware random number generator H. Peter Anvin
2012-09-16 23:23 ` Anthony Liguori
2012-09-16 23:36 ` H. Peter Anvin [this message]
2012-09-17 3:21 ` Amit Shah
2012-09-17 4:27 ` H. Peter Anvin
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=50566295.8020604@zytor.com \
--to=hpa@zytor.com \
--cc=amit.shah@redhat.com \
--cc=anthony@codemonkey.ws \
--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).