Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2580803yba; Sun, 7 Apr 2019 23:32:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmJOtKOdXTJVm8zajA/ADrjaX81sG4CKz2gfj1tV9dXoeID4wD5aGRZhd/XtGfRkiRPC2Y X-Received: by 2002:a17:902:a513:: with SMTP id s19mr27504201plq.97.1554705170641; Sun, 07 Apr 2019 23:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554705170; cv=none; d=google.com; s=arc-20160816; b=nOJADEZmgsU51EnYFALl3oGbSW+anxsO4hS4Xp9uMx4J5LWpPYGayrxL30JkadvB10 daX4yWhfZxufoX/NMdb53tj3n2bfa1Cd08jl8v+lDntrYpXYRbOBad/kClva8VWC/Lit R4LZb6yaekwCVyv7+ckcuAgefIZP3UT457kNoJph0OHtzn8/Osf/Oq6n9qJAXdhlxNia srEazUnr9bLsUiyIl6ldQ5IDuoh3NAKGT1EuESH+vTUX+nn/rpA6cHoz56UgQbQOkjGC 6loidksxdPeacAHK5N+KlESPnobRch/1hkMmBVjP1+j7xOjKZRNYJPGR9FOrNupfeOS2 ba4g== 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=oq9QYi4fifxIiN5rWpVb+Xd5bnkd79S0QYNqA5LBZmo=; b=yeoIvla2blCuh2Zra4NEciXJRxAxYGk8/vR9XP9HXYD7+4sjJjeR10/8YQi9lx5jtY AH/ElUyVMo30AjXc2uf6AV2/O835WkFwnlfxBhhaXyUdo+v4V41U49XSnse9X658FOZg RQ77RdtcDa2qB6QFWhLmPLNRrKMNqAar9FOtNuDGWVkGl9R5z4tsFzrSQW+t7km7f5b3 0qExE5aCFK4Nne6gqyPSDG5RJfocSPYtsDavs7zPVqoulQ3xBNCTMR3+R5F1YyQNXIQn aYqr2tF+IXlF2xaWAwd4wrKOyxlqu7ohwIixbCS6qnlIFWuOWi3K+94H0qRZhPZGM7Ov UMzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 w19si18550594ply.103.2019.04.07.23.32.35; Sun, 07 Apr 2019 23:32:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726464AbfDHGb7 (ORCPT + 99 others); Mon, 8 Apr 2019 02:31:59 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:44218 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725953AbfDHGb7 (ORCPT ); Mon, 8 Apr 2019 02:31:59 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hDNoz-0007xX-Ox; Mon, 08 Apr 2019 14:31:57 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hDNow-0003Pt-Ho; Mon, 08 Apr 2019 14:31:54 +0800 Date: Mon, 8 Apr 2019 14:31:54 +0800 From: Herbert Xu To: Laurent Vivier Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Matt Mackall Subject: Re: [PATCH] hwrng: core - don't block in add_early_randomness() Message-ID: <20190408063154.7bnt6puawoqtwlgo@gondor.apana.org.au> References: <20190329163011.7370-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190329163011.7370-1-lvivier@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 29, 2019 at 05:30:11PM +0100, Laurent Vivier wrote: > If the device is not ready to provide data the kernel will > be stuck indefinitely in the init function. > > This is not a problem if the device is driven using a module, > but if the driver is linked directly into the kernel then the > kernel boot sequence hangs. > > This can happen with virtio-rng device with rng-egd backend > with no data provider, for instance with QEMU command line parameters: > > ... > -chardev socket,id=charrng0,host=localhost,port=2345,server,nowait \ > -object rng-egd,id=objrng0,chardev=charrng0 \ > -device virtio-rng-pci,rng=objrng0,id=rng0 > > To avoid that, we can call rng_get_data() in non blocking mode because > the function already manages the case where byte_read is > 0 (if the device is not already initialized). > > See also commit d3cc7996473a > ("hwrng: fetch randomness only after device init") > > Signed-off-by: Laurent Vivier I think this is either not a bug (make sure that the user supplies a RNG source) or it should be addressed in virtio-rng. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt