qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: linux-s390@vger.kernel.org,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Theodore Ts'o" <tytso@mit.edu>, "KVM list" <kvm@vger.kernel.org>,
	adrian@parity.io, "Jann Horn" <jannh@google.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	ben@skyportsystems.com, "Weiss, Radu" <raduweis@amazon.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Richard W.M. Jones" <rjones@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"Catangiu, Adrian Costin" <acatan@amazon.com>,
	graf@amazon.com,
	"Linux Crypto Mailing List" <linux-crypto@vger.kernel.org>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Colm MacCarthaigh" <colmmacc@amazon.com>,
	"Singh, Balbir" <sblbir@amazon.com>,
	"Woodhouse, David" <dwmw@amazon.co.uk>,
	ehabkost@redhat.com
Subject: Re: [PATCH RFC v1 0/2] VM fork detection for RNG
Date: Thu, 24 Feb 2022 11:43:40 +0100	[thread overview]
Message-ID: <CAHmME9ogtK-iS7Szodbf47iGGJJ7TAxtico4P_-VRRYkUtUKgw@mail.gmail.com> (raw)
In-Reply-To: <2653b6c7-a851-7a48-f1f8-3bde742a0c9f@redhat.com>

Hi Lazlo,

Thanks for your reply.

On Thu, Feb 24, 2022 at 9:23 AM Laszlo Ersek <lersek@redhat.com> wrote:
> QEMU's related design is documented in
> <https://git.qemu.org/?p=qemu.git;a=blob;f=docs/specs/vmgenid.txt>.

I'll link to this document on the 2/2 patch next to the other ones.

> "they can also use the data provided in the 128-bit identifier as a high
> entropy random data source"
>
> So reinitializing an RNG from it is an express purpose.

It seems like this is indeed meant to be used for RNG purposes, but
the Windows 10 RNG document says: "Windows 10 on a Hyper-V VM will
detect when the VM state is reset, retrieve a unique (not random)
value from the hypervisor." I gather from that that it's not totally
clear what the "quality" of those 128 bits are. So this patchset mixes
them into the entropy pool, but does not credit it, which is
consistent with how the RNG deals with other data where the conclusion
is, "probably pretty good but maybe not," erring on the side of
caution. Either way, it's certainly being used -- and combined with
what was there before -- to reinitialize the RNG following a VM fork.

>
> More info in the libvirt docs (see "genid"):
>
> https://libvirt.org/formatdomain.html#general-metadata

Thanks, noted in the 2/2 patch too.

> QEMU's interpretation of the VMGENID specifically as a UUID (which I
> believe comes from me) has received (valid) criticism since:
>
> https://github.com/libguestfs/virt-v2v/blob/master/docs/vm-generation-id-across-hypervisors.txt
>
> (This document also investigates VMGENID on other hypervisors, which I
> think pertains to your other message.)

Thank you very much for this reference! You're absolutely right here.
v3 will treat this as just an opaque 128-bit binary blob. There's no
point, anyway, in treating it as a UUID in the kernel, since it never
should be printed or exposed to anywhere except random.c (and my gifs,
of course :-P).

>
> > (It appears there's a bug in QEMU which prevents
> > the GUID from being reinitialized when running `loadvm` without
> > quitting first; I suppose this should be discussed with QEMU
> > upstream.)
>
> That's not (necessarily) a bug; see the end of the above-linked QEMU
> document:
>
> "There are no known use cases for changing the GUID once QEMU is
> running, and adding this capability would greatly increase the complexity."

I read that, and I think I might disagree? If you're QEMUing with the
monitor and are jumping back and forth and all around between saved
snapshots, probably those snapshots should have their RNG
reinitialized through this mechanism, right? It seems like doing that
would be the proper behavior for `guid=auto`, but not for
`guid={some-fixed-thing}`.

> > So that's very positive. But I would appreciate hearing from some
> > ACPI/Virt/Amazon people about this.
>
> I've only made some random comments; I didn't see a question so I
> couldn't attempt to answer :)

"Am I on the right track," I guess, and your reply has been very
informative. Thanks for your feedback. I'll have a v3 sent out not
before long.

Jason


  reply	other threads:[~2022-02-24 10:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 13:12 [PATCH RFC v1 0/2] VM fork detection for RNG Jason A. Donenfeld
2022-02-23 13:12 ` [PATCH RFC v1 1/2] random: add mechanism for VM forks to reinitialize crng Jason A. Donenfeld
2022-02-23 23:16   ` Eric Biggers
2022-02-24  0:54     ` Jason A. Donenfeld
2022-02-24  1:27       ` Eric Biggers
2022-02-24 11:15         ` Jason A. Donenfeld
2022-02-23 13:12 ` [PATCH RFC v1 2/2] drivers/virt: add vmgenid driver for reinitializing RNG Jason A. Donenfeld
2022-02-23 16:36   ` Jason A. Donenfeld
2022-02-23 16:08 ` [PATCH RFC v1 0/2] VM fork detection for RNG Jason A. Donenfeld
2022-02-23 16:19   ` Jason A. Donenfeld
2022-02-24  8:22   ` Laszlo Ersek
2022-02-24 10:43     ` Jason A. Donenfeld [this message]
2022-02-24 10:55     ` Daniel P. Berrangé
2022-02-24 10:57       ` Jason A. Donenfeld
2022-02-25 10:40         ` Michael S. Tsirkin
2022-02-24  8:53 ` Alexander Graf
2022-02-24 10:43   ` Daniel P. Berrangé
2022-02-24 11:35     ` Alexander Graf
2022-02-24 10:53   ` Jason A. Donenfeld

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=CAHmME9ogtK-iS7Szodbf47iGGJJ7TAxtico4P_-VRRYkUtUKgw@mail.gmail.com \
    --to=jason@zx2c4.com \
    --cc=acatan@amazon.com \
    --cc=adrian@parity.io \
    --cc=ben@skyportsystems.com \
    --cc=berrange@redhat.com \
    --cc=colmmacc@amazon.com \
    --cc=dwmw@amazon.co.uk \
    --cc=ehabkost@redhat.com \
    --cc=graf@amazon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=imammedo@redhat.com \
    --cc=jannh@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=lersek@redhat.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=raduweis@amazon.com \
    --cc=rjones@redhat.com \
    --cc=sblbir@amazon.com \
    --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).