qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Hubert Kario <hkario@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Cole Robinson <crobinso@redhat.com>,
	libvirt-list@redhat.com, qemu-devel <qemu-devel@nongnu.org>,
	"Richard W.M. Jones" <rjones@redhat.com>,
	Peter Krempa <pkrempa@redhat.com>,
	Amit Shah <amit.shah@redhat.com>,
	mik@miknet.net, jjaburek@redhat.com, sgrubb@redhat.com,
	Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] RFC: virtio-rng and /dev/urandom
Date: Mon, 18 Apr 2016 12:26:24 +0100	[thread overview]
Message-ID: <20160418112624.GE19600@redhat.com> (raw)
In-Reply-To: <3348132.1ImxLpUXPh@pintsize.usersys.redhat.com>

On Mon, Apr 18, 2016 at 01:07:40PM +0200, Hubert Kario wrote:
> On Monday 18 April 2016 02:46:19 H. Peter Anvin wrote:
> > Another thing that really needs to be addressed, but is a separate
> > issue: invalidating and reseeding the entropy pool after a snapshot
> > event.
> 
> definitely agreed
> 
> though just reseeding would be sufficient - the goal is to make the 
> output unpredictable and unique between multiple machines starting from 
> the same snapshot, feeding enough random data to make the entropy pool 
> unique again is sufficient to achieve that

If you're spawning multiple machines from the same base snapshot,
the seeding of RNG is just one of many many things that need
dealing with. eg new /etc/machine-id, new ssh host keys, changing
MAC address of NICs with corresponding guest config file changes,
many other application specific identifiers / keys intended to
be unique per machine.  As such, libvirt explicitly tries to
prevent you spawning multiple machines from the same snapshot.

That all said, Microsoft HyperV has defined a concept of a
"Virtual Machine Generation ID" and specified various hypervisor
operations which should result in this value changing[1]. For example
restoring from a snapshot should always change the genid, as would
restoring from backup, or cloned from another image, or failed over
during disaster recovery.

This vm genid is exposed to the guest via ACPI and there's an
notification whenever it changes.

There are patches for QEMU[2] to support this feature in a manner that
is compatible with the hyperv spec, but they are sadly still not
merged :-(

So it would be possible for the Linux kernel to re-initialize its
RNG after snapshot by hooking into the vm-genid ACPI notification.


Regards,
Daniel

[1] https://lists.nongnu.org/archive/html/qemu-devel/2014-10/msg00489.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05599.html
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2016-04-18 11:26 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   ` [Qemu-devel] " Steve Grubb
2016-04-15 15:47 ` 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 [this message]
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=20160418112624.GE19600@redhat.com \
    --to=berrange@redhat.com \
    --cc=amit.shah@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 \
    --cc=sgrubb@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).