Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3394081ybp; Sun, 6 Oct 2019 10:59:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBt9XjvzWwkEQdkO8nGSetgGucGQklCWC11UFeY4HMIV8hVG4IdlpsZu8noih+wYxyT5Ai X-Received: by 2002:a17:906:3190:: with SMTP id 16mr20778571ejy.202.1570384746388; Sun, 06 Oct 2019 10:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384746; cv=none; d=google.com; s=arc-20160816; b=09EbwBqX2vArx6lg1V0RSChi87thGhj3qolc1tDh2mf14lzKGyuG8SPMK4W2ECEd0N EgGPYaziCPZAzsFHNIRfUvZHwqDudZsgdR04Qj+CtBadOOsYTOAEPHZ5FrBilG9U9Bdw hDWLcvPTKatntAD5R1PDji52Z9K5n4SiBB+UGzHmwWoA78ppJ4VN4PYKe6wvE5t21CFC yr0ORV6I47hclaMAbzaJByHIBakal2ZoFu9YlCAm+fm3bAz2+aL0gievTrD//JVFeRZU Yl7X7KdFKdL/h/ZoFcMJhcKAw6R7Bo93+AY9+7T7IBs/nnuNpLFferhg1Zvb2bkzyhnq iAjw== 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=zminMk6+Oq085ySFq7Vrl6FM4aBPHunPyuhbZBG+ZIM=; b=Ko+iesQEClJqpzMqSQAgeUc6umYdTVsjwqtShZPDnzjiftaADq25pBUvtEKlv9aUDq PYe2Ey2kVp2iSBS4OohsnAdz9Eda5++hrmGGZwJHrCInyVUTSrFgp/oba+wSGq5uzrOs jQRtm8FMQ2jb7/NYvNa80J0Lg5rpKD9bPZWuAKBiWOml7S8fCowqDt/zExOUlU8kZ5NC uGcDRUtgP2Nk8xPW+9L9466p9DB9WE/SSw3KH7b//Sloj4H9TvnhsWrGse13bQAs16IS OvF3gkJQ4b5yrKyGM9SMPEWAjlwWCJAlv7B5bK2RsXCy02M5HTO6row2PQB9YEsn8n14 w10w== 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 i3si6775180edq.163.2019.10.06.10.58.42; Sun, 06 Oct 2019 10:59:06 -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 S1730000AbfJFRfH (ORCPT + 99 others); Sun, 6 Oct 2019 13:35:07 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:53906 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730127AbfJFRfF (ORCPT ); Sun, 6 Oct 2019 13:35:05 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 88382804A9; Sun, 6 Oct 2019 19:34:47 +0200 (CEST) Date: Sun, 6 Oct 2019 19:35:02 +0200 From: Pavel Machek To: Linus Torvalds Cc: Thomas Gleixner , "Ahmed S. Darwish" , LKML , Theodore Ts'o , Nicholas Mc Guire , the arch/x86 maintainers , Andy Lutomirski , Kees Cook Subject: Re: x86/random: Speculation to the rescue Message-ID: <20191006173501.GA31243@amd> References: <20191006114129.GD24605@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun 2019-10-06 10:26:18, Linus Torvalds wrote: > On Sun, Oct 6, 2019 at 4:41 AM Pavel Machek wrote: > > > > Should we have some kind of notifier chain, so that we could utilize > > better random sources (spinning rust) if we had them? >=20 > The spinning rust will get entropy on its own just thanks to the > regular interrupt stuff. And the kernel tryin gto do IO is a bad > idea. It will not: boot is now halted because systemd wants some entropy. Everything is idle and very little interrupts are happening. We have spinning rust, but it is idle, and thus not generating any interrupts. > Plus I think it's kind of pointless to do anythign at all for things > like spinning rust in this day and age. It's no longer relevant, and > never really was in the area where this was a problem. >=20 > Also, I don't really like the notion of random (sic) notifiers that > different drivers or things could attach to this thing. People will > disagree about how much entropy it has anyway, and I'd rather have > _one_ clear implementation that people can look at and comment on and > try to actually write an academic paper on and suggest improvements > to, than some generic "entropy notifier interface" that then gets > whatever input somebody decides is appropriate. >=20 > We already have interfaces for "I think I have interesting data": > add_interrupt_randomness(), add_device_randomness(), > add_hwgenerator_randomness() are all for different sources of > entropy. I'm not suggesting the notifier would invent some entropy... I agree that kernel doing IO is strange, but I'm suggesting just that: if userspace is blocked waiting for entropy, do some I/O, and let interrupt randomness do its job. It will work great on spinning rust. It will also work somehow on SSDs and SD cards etc, because they have separate CPUs these days. They'll certainly generate some interrupts, and we already assign some randomness to that... It will let the machine boot, and entropy calculation rules do not need to change. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl2aJcUACgkQMOfwapXb+vJoQwCfVYSJea7N8MJtkKLYFp8F2PgP PG0AnRqDVeQLLkeq8toHSyfHc5+0kESP =QjAp -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--