public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Theodore Tso <tytso@mit.edu>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Jeff Garzik <jeff@garzik.org>,
	LKML <linux-kernel@vger.kernel.org>,
	virtualization@lists.linux-foundation.org,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Matt Mackall <mpm@selenic.com>,
	Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH 2/2] lguest: virtio-rng support
Date: Mon, 19 May 2008 19:28:12 +1000	[thread overview]
Message-ID: <200805191928.13043.rusty@rustcorp.com.au> (raw)
In-Reply-To: <48314419.4080606@goop.org>

On Monday 19 May 2008 19:10:49 Jeremy Fitzhardinge wrote:
> Rusty Russell wrote:
> > On Saturday 17 May 2008 17:47:01 Jeremy Fitzhardinge wrote:
> >> But the host->guest protocol should include the number of bits estimated
> >> entropy along with the bits themselves.
> >
> > If we go down that path, we have to come up with a way of feeding that
> > information to guest userspace.  Patches welcome.  If we meanwhile assume
> > entropy == #bits, it fits the current /dev/hwrng model, and we can add an
> > entropy count later if we want to change that.
>
> Really?  Wouldn't guest userspace just use /dev/random as usual, which I
> think does have an ioctl to give that kind of information?  And the
> interfaces do allow things injecting entropy into the kernel pool to
> provide entropy estimates along with the actual bits themselves.

Unfortunately not.  Hardware randomness devices export /dev/hwrng, and it's up 
to userspace to feed that into /dev/random (or not).  That's usually done by 
rngd, which at least on my system, assumes 1 bit of entropy per bit of data 
from /dev/hwrng by default.

I was a little surprised that this decision was exported to userspace, but if 
you're not prepared to unconditionally trust hw rngs, it makes sense to palm 
it off.  We could write a boutique device for virtualization which *did* feed 
directly, but that would be a little gauche.

Cheers,
Rusty.

  reply	other threads:[~2008-05-19  9:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15 18:48 Virt RNG? Jeff Garzik
2008-05-15 19:53 ` Jeremy Fitzhardinge
2008-05-15 20:26   ` Dor Laor
2008-05-15 20:31 ` Christian Borntraeger
2008-05-15 20:44   ` Jeff Garzik
2008-05-15 20:43 ` Jeff Dike
2008-05-15 23:43 ` Rusty Russell
2008-05-16  0:07   ` Henrique de Moraes Holschuh
2008-05-16  5:31   ` [PATCH 1/2] virtio: hardware random device Rusty Russell
2008-05-16  5:39     ` [PATCH 2/2] lguest: virtio-rng support Rusty Russell
2008-05-16 10:49       ` Johannes Berg
2008-05-16 20:25         ` H. Peter Anvin
2008-05-17  4:46         ` Rusty Russell
2008-05-17  4:50           ` H. Peter Anvin
2008-05-17  6:28             ` Rusty Russell
2008-05-17  6:43               ` Herbert Xu
2008-05-17  7:43                 ` Christian Borntraeger
2008-05-17 15:56                   ` H. Peter Anvin
2008-05-17  7:47               ` Jeremy Fitzhardinge
2008-05-19  9:05                 ` Rusty Russell
2008-05-19  9:10                   ` Jeremy Fitzhardinge
2008-05-19  9:28                     ` Rusty Russell [this message]
2008-05-19  9:45                       ` Jeremy Fitzhardinge
2008-05-17 15:57               ` H. Peter Anvin
2008-05-16  7:31     ` [PATCH 1/2] virtio: hardware random device Christian Borntraeger

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=200805191928.13043.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=borntraeger@de.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=jeff@garzik.org \
    --cc=jeremy@goop.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=tytso@mit.edu \
    --cc=virtualization@lists.linux-foundation.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