Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1792430ybj; Sun, 22 Sep 2019 12:03:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbJA1AGiFM19q27rNOY7PuQNP2uo8pp9xgGULU+Bbk/1i0AzEs92Ulnozqy3YkCJP/VZhj X-Received: by 2002:a17:906:b2d4:: with SMTP id cf20mr24441785ejb.152.1569178994863; Sun, 22 Sep 2019 12:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569178994; cv=none; d=google.com; s=arc-20160816; b=NH/ElNpif5zbw/NlWItEvzvCfmTxIgQQL3dMgUBvRGwIPA3ky634q4mlF7/YUKGpaI Y2Tg3u0QECYG/3bkH7XcDym5frMvJ/4TNJH/cMV7ltQFx1dmGQCbpIqPk7OsG7H85fLm k/M8siyhWzTBP+yZkWLhERqYLinYybj64XVX5QGzhGBTWixo68Gly2nOwaHI6XWGf6hy BjlA3CjCZxrfo8LkRjaYdFrfkS+VwfTc40DgUowPsWcdbzNDZP694sZZk9OiFKfCT+aO ZX8aMRIhpaDRr85ddrptkxQXeLkUHBktjWCA6DQJWljwv4yBHWBGtZVe1Xkn+jH/fcJE 5BgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=yZC7UfH3IJ+OMu6PbEVEZE+wwcd/+/vzsmvHMbBvl+4=; b=pqm3/HW2xpbC4XJXAARTTOjwUnPGBqQiABP0+DGZoM4VhzWkMO2hyoqFSTCDvbTmgC 6oU1leovXYPvW8uGQd/nVgpc0oEbPVMcf7O9JHmM0LNDVuN1G0ctTEiW0IaUUKV+VtQY QSReg7S5m0b2gtTvy43eubNM0EztmzrlNrT+DVl7541M2Kf3agX6gyPOI8afzarVYW0R MPzVY47p6Tw+udlG4q5fCOJXTpCoQ80jqXyKrmPVQ7eoqsFjQComltYnF6MJykQHiobc mnWqd4TLG8YWDsQChQ1FYezwItwc9/CRqD0uMmIW5+R417yx28lVhIoA+OjH+8K/X2XE q/Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="P/3bfx5R"; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si5410708edb.433.2019.09.22.12.02.49; Sun, 22 Sep 2019 12:03:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="P/3bfx5R"; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728546AbfITUMF (ORCPT + 99 others); Fri, 20 Sep 2019 16:12:05 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:35809 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726094AbfITUMF (ORCPT ); Fri, 20 Sep 2019 16:12:05 -0400 Received: by mail-lf1-f65.google.com with SMTP id w6so5896669lfl.2; Fri, 20 Sep 2019 13:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to; bh=yZC7UfH3IJ+OMu6PbEVEZE+wwcd/+/vzsmvHMbBvl+4=; b=P/3bfx5RxC8pnaVe0vR5frKRv4pk5Yka/6ZXYQecHbgGOECWhlja/wgJcY60EPUc3I OPtIPyhClP7xVVc7V3mhtijyehME9MiWd/DuDVDkQYW6O7suRFTrEgsX5lI9PC7/bku5 uwamOphOcK7eMwpEHXKGzWPtUGpyUoywd8p06jw8Q2bQ0fWzuwPe0avbrHl+knhkkJ8a dTtTNKghb3p/eTUnmQNnQ3INEDXlN/lwVkHHIYeCWXAZzBpDbRHheooI+hUsJwWD/9oI z/w6tdA5xwoL5J7cK649aEBNcbLTjNYRfLFk/ZINIVxDsdPRhzS12qqeDIXX+EoLlHP/ i9PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=yZC7UfH3IJ+OMu6PbEVEZE+wwcd/+/vzsmvHMbBvl+4=; b=HH7R89LyLMolKW4tfpOUZjGJ6IivTjBTP8VEdxV7vJgj1hiNGdtlRLwIZfzICbJL0l TAQDoH7scUAukHLMc3yl27jilDlzaiF2nW9EsDPt6BS4xFDG/iQkkvCMU6t9v0Jt7Gay H2y5bHy9qboAdCy1yvifIslYb+l4wRElhBsXB7obuNSa3vTlry2tIFOplieFkAyqvAVc VvGgbPNHw6CAoksjpgxdTvG2YHOt4D205C49Q4Vov0Jt9yPn7sELvtZYep2QsW0sNwJL pCW4LUGdli38Bsxj2ai4VVfUGynLg/wkX+hzp0neIZEFURh8eSOeaCWJuzBZEhtQfk7v ZqfQ== X-Gm-Message-State: APjAAAWVZbvUO5r+uXSx7EcpGHGutYFkIZ5pkb/BCTNuZoEY04c6j9gr uF8Nk46Smys0DVJ4r3bbha6v449cqkIm8g== X-Received: by 2002:a19:f247:: with SMTP id d7mr9431847lfk.191.1569010320132; Fri, 20 Sep 2019 13:12:00 -0700 (PDT) Received: from ?IPv6:2a02:17d0:4a6:5700:d63d:7eff:fed9:a39? ([2a02:17d0:4a6:5700:d63d:7eff:fed9:a39]) by smtp.googlemail.com with ESMTPSA id v1sm649085lfq.89.2019.09.20.13.11.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Sep 2019 13:11:59 -0700 (PDT) Subject: Re: [PATCH RFC v4 1/1] random: WARN on large getrandom() waits and introduce getrandom2() To: Linus Torvalds , Andy Lutomirski Cc: "Ahmed S. Darwish" , Lennart Poettering , "Theodore Y. Ts'o" , "Eric W. Biederman" , Michael Kerrisk , Willy Tarreau , Matthew Garrett , lkml , Ext4 Developers List , Linux API , linux-man References: <20190912034421.GA2085@darwi-home-pc> <20190912082530.GA27365@mit.edu> <20190914122500.GA1425@darwi-home-pc> <008f17bc-102b-e762-a17c-e2766d48f515@gmail.com> <20190915052242.GG19710@mit.edu> <20190918211503.GA1808@darwi-home-pc> <20190918211713.GA2225@darwi-home-pc> <20190920134609.GA2113@pc> From: "Alexander E. Patrakov" Message-ID: Date: Sat, 21 Sep 2019 01:11:57 +0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="------------ms020002090106010507010501" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org This is a cryptographically signed message in MIME format. --------------ms020002090106010507010501 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-PH Content-Transfer-Encoding: quoted-printable 21.09.2019 00:51, Linus Torvalds =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > And we'll also have to make getrandom(0) be really _timely_. Security > people would likely rather wait for minutes before they are happy with > it. But because it's a boot constraint as things are now, it will not > just be jitter-entropy, it will be _accelerated_ jitter-entropy in 15 > seconds or whatever, and since it can't use up all of CPU time, it's > realistically more like "15 second timeout, but less of actual CPU > time for jitter". I don't think that "accelerated jitter" makes sense. The jitterentropy=20 hwrng that I sent earlier fills the entropy buffer in less than 2=20 seconds, even with quality=3D4, so there is no need to accelerate it even= =20 more. > That said, if we can all convince everybody (hah!) that jitter entropy > in the kernel would be sufficient, then we can make the whole point > entirely moot, and just say "we'll just change crng_wait() to do > jitter entropy instead and be done with it. Then any getrandom() user > will just basically wait for a (very limited) time and the system will > be happy. >=20 > If that is the case we wouldn't need new flags at all. But I don't > think you can make everybody agree to that, which is why I suspect > we'll need the new flag, and I'll just take the heat for saying "0 is > now off limits, because it does this thing that a lot of people > dislike". I 100% agree with that. --=20 Alexander E. Patrakov --------------ms020002090106010507010501 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: Криптографическая подпись S/MIME MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCC C5wwggVNMIIENaADAgECAhArQ2N9hOajPiuqD20bI16wMA0GCSqGSIb3DQEBCwUAMIGCMQsw CQYDVQQGEwJJVDEPMA0GA1UECAwGTWlsYW5vMQ8wDQYDVQQHDAZNaWxhbm8xIzAhBgNVBAoM GkFjdGFsaXMgUy5wLkEuLzAzMzU4NTIwOTY3MSwwKgYDVQQDDCNBY3RhbGlzIENsaWVudCBB dXRoZW50aWNhdGlvbiBDQSBHMTAeFw0xOTA2MDYwODAxMzVaFw0yMDA2MDYwODAxMzVaMB0x GzAZBgNVBAMMEnBhdHJha292QGdtYWlsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBAOA0sb1ubDnIK32rbgW3BnjBcx1pYuEFOCU6aPVJ2gU+wtKJgAo9IdVUXG6kC1fF hXjIcZHOgbEqzFjHK1yXlHIUWEv+N8KdmBDOK1UdKQj58d9A4hnH62iEiwQsOR5YT1UyHX4A pfMjsBja7254cixR4jOPzfA4YUD6JTTPioyjDwuYQlhweVyXziKswLtGWfKeDcm3fOlKYxGy hxjWJRamGTreNBVC9uMkF4DHszpUm07agR2U4mnW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