Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1563330ybj; Fri, 20 Sep 2019 12:30:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJA511lo8I/3px3yUNTj8pBBRPfoXz+jUSI5MW6bPHLmmeSXsZNLsbegmbcbvz0FqgdUIW X-Received: by 2002:a17:906:6dd4:: with SMTP id j20mr20683798ejt.173.1569007854773; Fri, 20 Sep 2019 12:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569007854; cv=none; d=google.com; s=arc-20160816; b=KRUk8qH3Pd8iiTjJQc6dDeyg2f03xFtgKinRcisC49Ucfc8ouwPEjYHEHEHT1Eipb6 RsV35A/sXY+WreP6y30vvpA2XQ81OSAG3Rnsq7emzYXB2sB0mMbRzcPW5O4atOLon4ln rvFSV15ynY4Jt0MGc8D/JVhLbNBQeD44DqWp3Qn6wfFH7+pmObW/gmTelXBboLxnTCH6 qDIDnSrngAkBT3SbVYqhkcpN75e+mc7ar4MGkJpisBs8BKgKLnA7Up2G1SrTolm1+l5j hwyRigpNeKulz/sR8VroRGEtUKMcyEG4EqnjYv3QhEZjInwAm7Im5qTCYvB8wYZB9tub uWaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NwJAVdzu/emJAYpByt7XcnecpYhJGxoG58gFx4hJ6Mk=; b=qqVY8DLhuKZ39b+w08GOcHVSt4rswFZVmbGMJwQRSpeNc4QRDZ312SR9tns4ARuiGr hY2JstZB15bZuqM5L5Y1VaZXrfSNqIgXk560Ltn1BflqkIx80L6bjWl6AssqElTkBON2 D/V7ZJDQnMdLuBfdrTNkI4cbgAdDgCTHRg1Wr29+5pjLz3jG0BSqk21fF363lG4Omvu7 iYZeoi2eKeBLqvMICgn0AgQ1IC6XReic+EVARTUohflW/5yzcD5C3Dlyz42Q2Z05iUkN DS7ZkQHEKH+aB21qDlNY9NhBummYmRGhxlMwiQRSCyKDGDzQL0UlIvKILzmhLF6jmqI+ QfwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y28si1558496edb.162.2019.09.20.12.30.29; Fri, 20 Sep 2019 12:30:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727004AbfITNDd (ORCPT + 99 others); Fri, 20 Sep 2019 09:03:33 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:34610 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726996AbfITNDd (ORCPT ); Fri, 20 Sep 2019 09:03:33 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.89 #2 (Debian)) id 1iBIZF-0007tI-SV; Fri, 20 Sep 2019 23:03:22 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 20 Sep 2019 23:03:20 +1000 Date: Fri, 20 Sep 2019 23:03:20 +1000 From: Herbert Xu To: Laurent Vivier Cc: linux-kernel@vger.kernel.org, Amit Shah , linux-crypto@vger.kernel.org, Matt Mackall Subject: Re: [PATCH] hw_random: don't wait on add_early_randomness() Message-ID: <20190920130319.GA23697@gondor.apana.org.au> References: <20190917095450.11625-1-lvivier@redhat.com> <20190917124018.GA32437@gondor.apana.org.au> <784e2129-0692-6e55-481d-4319cef9694c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <784e2129-0692-6e55-481d-4319cef9694c@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 > >> --- > >> 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 Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt