From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2FDDC2D0DA for ; Thu, 26 Dec 2019 11:41:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30AC8206CB for ; Thu, 26 Dec 2019 11:41:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=chronox.de header.i=@chronox.de header.b="WNEAJ7bf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726277AbfLZLl1 (ORCPT ); Thu, 26 Dec 2019 06:41:27 -0500 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.50]:18606 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbfLZLl1 (ORCPT ); Thu, 26 Dec 2019 06:41:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1577360485; s=strato-dkim-0002; d=chronox.de; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=mjCAlXQFM791pXZ+5qe3BYMWt7Wm/tbMO9xWf+vRptk=; b=WNEAJ7bfLsiew2LcX+oF5GDc/Tth0nQq2gNzqaAx+n+KwmzFL7w0QDT0IJJZOy/qKS VQTjyH7HwERUKOlbMcyP/CSF+8J+RdmjcxUgwcvw9DQ4E1Kt8ng5Z3MZ6HyIUfd6drTN ntzjUgs1B+zaM5L0PZLPSak26lIeaujowSOrbCLV+igv9VhpzIu60lHhKsXIcpGhVM98 7NxvMAIgVhy+Ye1F/EsDeJVy5NW6E6GUowSxL7tT5rwBqDvBwRLc1vtaqA7y3wD5Essb 3+RSiqbfWU1SOTwu1ISiQdobojZo2g2x574c0m/y4HCxOHEkjuZ1+I/YDTyHC412QQCq TU6A== X-RZG-AUTH: ":P2ERcEykfu11Y98lp/T7+hdri+uKZK8TKWEqNyiHySGSa9k9xmwdNnzGHXPaIPSZNQ==" X-RZG-CLASS-ID: mo00 Received: from tauon.chronox.de by smtp.strato.de (RZmta 46.1.3 DYNA|AUTH) with ESMTPSA id e09841vBQBedBPY (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 26 Dec 2019 12:40:39 +0100 (CET) From: Stephan Mueller To: Matthew Garrett Cc: Andy Lutomirski , Ted Ts'o , LKML , Linux API , Kees Cook , "Jason A. Donenfeld" , "Ahmed S. Darwish" , Lennart Poettering , "Eric W. Biederman" , "Alexander E. Patrakov" , Michael Kerrisk , Willy Tarreau , Ext4 Developers List , linux-man Subject: Re: [PATCH v3 0/8] Rework random blocking Date: Thu, 26 Dec 2019 12:40:38 +0100 Message-ID: <8794771.pXx7ivobnm@tauon.chronox.de> In-Reply-To: <20191226100334.bsh3b3dphs4j4cvx@srcf.ucam.org> References: <9872655.prSdhymlXK@positron.chronox.de> <20191226100334.bsh3b3dphs4j4cvx@srcf.ucam.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Sender: linux-man-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org Am Donnerstag, 26. Dezember 2019, 11:03:34 CET schrieb Matthew Garrett: Hi Matthew, > On Thu, Dec 26, 2019 at 10:29:00AM +0100, Stephan M=FCller wrote: > > What about offering a compile-time option to enable or disable such cod= e? > > Note, with the existing random.c code base, there is no need to have a > > separate blocking_pool. The ChaCha20 DRNG could be used for that very s= ame > > purpose, provided that in case these true random numbers are generated > > when > > the Chacha20 DRNG received an equal amount of "unused" entropy. >=20 > I think it's reasonable to offer such an option as long as it's made > clear that it'll break userland and should only be enabled under very > weird circumstances. We don't want to end up in a situation where > userland developers feel that they need to code to handle such > situations - the only people who care about this distinction should be > in control of their userland stack and able to cope with the > consequences. Ok. >=20 > > If an unprivileged caller requests true random data, at least 1024 bits= of > > entropy is left in the pool. I.e. all entropy above that point is > > available > > for this request type. Note, even namespaces fall into this category > > considering that unprivileged users can create a user name space in whi= ch > > they can become root. >=20 > I also feel like describing any of this as "true random data" is > misleading. Most of our entropy sources are devices that could, given > sufficient information, be modelled accurately. We're not sampling > quantum events here. I am fine using any terminology that fits. The terminology I used comes from the German AIS 31: """ True RNG: A device or mechanism for which the output values depend on some= =20 unpredictable source (noise source, entropy source) that produces entropy. Note: The class of TRNGs splits into two subclasses (PTRNGs and NPTRNGs). """ Bottom line, a TRNG produces random numbers at an equal rate as the underly= ing=20 noise source produces entropy. E.g. if the noise source produces 10 bits of= =20 entropy, the RNG shall only generate 10 bits of random data. A physical TRNG (PTRNG) uses a physical phenomenon like shot noise of a dio= de=20 in a ring oscillator. Commonly, stochastical models can be created for thos= e=20 noise sources. A non-physical TRNG (NPTRNG) uses non-physical phenomenons like timing of=20 events as noise source. The random.c or my LRNG are NPTRNGs. For NPTRNGs it= is=20 unlikely that there is a stochastical model. Ciao Stephan