qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Amit Shah <amit.shah@redhat.com>,
	qemu-devel@nongnu.org, Andreas Faerber <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 2/4] virtio-rng-pci: create a default backend if none exists
Date: Fri, 26 Oct 2012 22:20:36 +0200	[thread overview]
Message-ID: <508AF094.1010802@redhat.com> (raw)
In-Reply-To: <87zk39ypue.fsf@codemonkey.ws>

Il 26/10/2012 21:51, Anthony Liguori ha scritto:
>> > If you make the default /dev/hwrng, however, that would be ok.
> /dev/hwrng may be (and stay) empty which seems unfortunate.

Unfortunate, but at least not wrong.

> I was thinking /dev/urandom would be a good pragmatic choice though.

No.

/dev/urandom is actively wrong because it provides the guest with the
illusion of an infinite source of entropy, while the guest is really
being fed with an infinite source of pseudo-random numbers.

/dev/random as a default is bad because on hosts without neither hwrng
nor rdrand it completely depletes the host's entropy pool.  Thus it
denies access to entropy to other programs running in the host.

I thought /dev/random with some throttling would be good, especially if
somehow the guest can be told to run rngd in skip-test mode, e.g. via a
virtio-rng feature bit.  Peter's last messages make me wonder if this is
correct.  If it is, the throttling can be implemented either in QEMU or
outside it (via a daemon that speaks the same protocol as egd).

/dev/random might be good in the special case where rngd is being run in
the host, and there is an hwrng or rdrand to feed rngd.  In this case
the guest can also be run in skip-test mode.  However, I don't have a
machine at hand (it's Friday evening here) to test whether rngd could
keep up, or a malicious guest would instead also deplete the host's
entropy tool too badly.

/dev/null makes the guest behave exactly as if no virtio-rng-pci is
present, so it is at least not wrong.

rdrand and /dev/hwrng seem to be the best choice at least to me.  Peter
seemed to agree initially, then said "This is surreal.  Output from
/dev/hwrng turns into output for /dev/random... it us guaranteed worse;
period, end of story".  I'm confused.

I hope the above is not too inaccurate and at least a decent way to
reset the discussion.

Paolo

  reply	other threads:[~2012-10-26 20:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26 17:21 [Qemu-devel] [PATCH 0/4] Enable virtio-{rng,balloon} by default Anthony Liguori
2012-10-26 17:21 ` [Qemu-devel] [PATCH 1/4] rng-random: split out header for rng-random Anthony Liguori
2012-10-26 17:21 ` [Qemu-devel] [PATCH 2/4] virtio-rng-pci: create a default backend if none exists Anthony Liguori
2012-10-26 18:59   ` Paolo Bonzini
2012-10-26 19:51     ` Anthony Liguori
2012-10-26 20:20       ` Paolo Bonzini [this message]
2012-10-26 19:53     ` Paolo Bonzini
2012-10-26 20:16       ` Anthony Liguori
2012-10-26 20:22         ` Paolo Bonzini
2012-10-26 17:21 ` [Qemu-devel] [PATCH 3/4] machine: add default_devices field to QEMUMachine Anthony Liguori
2012-11-05 12:27   ` Markus Armbruster
2012-10-26 17:21 ` [Qemu-devel] [PATCH 4/4] pc-1.3: add virtio-rng and virtio-balloon to the default machine Anthony Liguori

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=508AF094.1010802@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=amit.shah@redhat.com \
    --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).