qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: Cole Robinson <crobinso@redhat.com>,
	libvirt-list@redhat.com, qemu-devel <qemu-devel@nongnu.org>,
	"Daniel P. Berrange" <berrange@redhat.com>,
	Peter Krempa <pkrempa@redhat.com>,
	Amit Shah <amit.shah@redhat.com>,
	mik@miknet.net, jjaburek@redhat.com, hkario@redhat.com,
	hpa@zytor.com, Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] RFC: virtio-rng and /dev/urandom
Date: Wed, 20 Apr 2016 18:48:39 -0400	[thread overview]
Message-ID: <2072206.ovhQoVSaJb@x2> (raw)
In-Reply-To: <20160415114646.GY11600@redhat.com>

On Friday, April 15, 2016 12:46:46 PM Richard W.M. Jones wrote:
> On Fri, Apr 15, 2016 at 06:41:34AM -0400, Cole Robinson wrote:
> > Libvirt currently rejects using host /dev/urandom as an input source for a
> > virtio-rng device. The only accepted sources are /dev/random and
> > /dev/hwrng. This is the result of discussions on qemu-devel around when
> > the feature was first added (2013). Examples:
> > 
> > http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02387.html
> > https://lists.gnu.org/archive/html/qemu-devel/2013-03/threads.html#00023
> > 
> > libvirt's rejection of /dev/urandom has generated some complaints from
> > users:
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=1074464
> > * cited: http://www.2uo.de/myths-about-urandom/
> > http://www.redhat.com/archives/libvir-list/2016-March/msg01062.html
> > http://www.redhat.com/archives/libvir-list/2016-April/msg00186.html
> > 
> > I think it's worth having another discussion about this, at least with a
> > recent argument in one place so we can put it to bed. I'm CCing a bunch of
> > people. I think the questions are:
> > 
> > 1) is the original recommendation to never use virtio-rng+/dev/urandom
> > correct?
> > 
> > 2) regardless of #1, should we continue to reject that config in libvirt?
> 
> There was a lot of internal-to-Red Hat discussion on this which I
> can't reproduce here unfortunately.  However the crux of it was that
> it's quite safe to read enormous amounts from /dev/urandom, even
> without adding any entropy at all, and use those numbers for
> cryptographic purposes.
> 
> Steve: can we disclose the research that was done into this?  If so
> can you summarise the results for us?

Joining a bit late...i was out last week. The requirement that caused the need 
for virt-rng came from Server Virtualization Protection Profile. This was also 
based on CSEG requirements in the UK. The requirement just asks if some 
entropy from the host can be made available to the guest. 

---

"FCS_ENT_EXT.1 Extended: Entropy for Virtual Machines

The TSF shall provide a mechanism to make available to VMs entropy that meets
FCS_RBG_EXT.1 through [ virtual device interface ].

The entropy need not provide high-quality entropy for every possible method 
that a VM might acquire it. The VMM must, however, provide some means for VMs 
to get sufficient entropy."

---

The fact is that urandom has entropy in it. It can be tested by

ioctl(fd, RNDGETENTCNT, &ent_count)

The idea is that the guest should be generating entropy on its own. But just 
in case there are scheduler artifacts present in the jitter and timing methods 
of harvesting entropy, we want to mix in a little entropy from the host to 
offset these effects. The requirement also does not specify how much or how 
often entropy is fed to a guest.

The requirement on the guest is that it needs to have 128 to 256 bits of 
entropy when generating a key.

-Steve

  parent reply	other threads:[~2016-04-20 22:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 10:41 [Qemu-devel] RFC: virtio-rng and /dev/urandom Cole Robinson
2016-04-15 11:46 ` Richard W.M. Jones
2016-04-15 11:54   ` [Qemu-devel] [libvirt] " Richard W.M. Jones
2016-04-20 22:48   ` Steve Grubb [this message]
2016-04-15 15:47 ` [Qemu-devel] " Eric Blake
2016-04-15 16:10   ` Hubert Kario
2016-04-16  0:46     ` H. Peter Anvin
2016-04-16  0:51     ` H. Peter Anvin
2016-04-16  8:31       ` Paolo Bonzini
2016-04-18  0:20         ` H. Peter Anvin
2016-04-18  0:27         ` H. Peter Anvin
2016-04-18 11:21           ` Hubert Kario
2016-04-18 11:00       ` Hubert Kario
2016-04-19 11:30   ` [Qemu-devel] [libvirt] " Yaniv Kaul
2016-04-15 15:56 ` [Qemu-devel] " H. Peter Anvin
2016-04-15 16:06   ` Hubert Kario
2016-04-18  9:28   ` Daniel P. Berrange
2016-04-18  9:46     ` H. Peter Anvin
2016-04-18 11:07       ` Hubert Kario
2016-04-18 11:26         ` Daniel P. Berrange
2016-04-18 21:45           ` H. Peter Anvin
2016-04-20 22:21 ` Cole Robinson

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=2072206.ovhQoVSaJb@x2 \
    --to=sgrubb@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=berrange@redhat.com \
    --cc=crobinso@redhat.com \
    --cc=eblake@redhat.com \
    --cc=hkario@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jjaburek@redhat.com \
    --cc=libvirt-list@redhat.com \
    --cc=mik@miknet.net \
    --cc=pbonzini@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /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).