mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: linux-kernel@vger.kernel.org, Amit Shah <amit@kernel.org>,
	linux-crypto@vger.kernel.org, Matt Mackall <mpm@selenic.com>
Subject: Re: [PATCH] hw_random: don't wait on add_early_randomness()
Date: Fri, 20 Sep 2019 23:03:20 +1000	[thread overview]
Message-ID: <20190920130319.GA23697@gondor.apana.org.au> (raw)
In-Reply-To: <784e2129-0692-6e55-481d-4319cef9694c@redhat.com>

On Tue, Sep 17, 2019 at 03:02:26PM +0200, Laurent Vivier wrote:
> On 17/09/2019 14:40, Herbert Xu wrote:
> > On Tue, Sep 17, 2019 at 11:54:50AM +0200, Laurent Vivier wrote:
> >> add_early_randomness() is called by hwrng_register() when the
> >> hardware is added. If this hardware and its module are present
> >> at boot, and if there is no data available the boot hangs until
> >> data are available and can't be interrupted.
> >>
> >> To avoid that, call rng_get_data() in non-blocking mode (wait=0)
> >> from add_early_randomness().
> >>
> >> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> >> ---
> >>  drivers/char/hw_random/core.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Please provide more context in your patch description such as which
> > driver actually causes a hang here.
> 
> I can add in the next version:
> 
> "For instance, in the case of virtio-rng, in some cases the host can be
> not able to provide enough entropy for all the guests.
> 
> We can have two easy ways to reproduce the problem but they rely on
> misconfiguration of the hypervisor or the egd daemon:
> 
> - if virtio-rng device is configured to connect to the egd daemon of the
> host but when the virtio-rng driver asks for data the daemon is not
> connected,
> 
> - if virtio-rng device is configured to connect to the egd daemon of the
> host but the egd daemon doesn't provide data.
> 
> The guest kernel will hang at boot until the virtio-rng driver provides
> enough data."

Patch applied with this addition.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2019-09-20 13:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17  9:54 Laurent Vivier
2019-09-17 12:40 ` Herbert Xu
2019-09-17 13:02   ` Laurent Vivier
2019-09-20 13:03     ` Herbert Xu [this message]
2019-09-17 15:36 ` Theodore Y. Ts'o

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=20190920130319.GA23697@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=amit@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvivier@redhat.com \
    --cc=mpm@selenic.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

all inboxes | Powered by JetHome®