Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13210353ybl; Sun, 29 Dec 2019 06:52:32 -0800 (PST) X-Google-Smtp-Source: APXvYqywgWuFuzuhYZ1TP+4L+buaDgGJ3fwTzUUFiGvne0GAPkZ8jwu6+G3sRfCidy99KVopcXD9 X-Received: by 2002:a05:6830:1f89:: with SMTP id v9mr65468666otr.90.1577631152796; Sun, 29 Dec 2019 06:52:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577631152; cv=none; d=google.com; s=arc-20160816; b=SKDwMNo8SMD4v38FRELeFyS5JW1nCnghGSJ+Z2z/A+AGXyvtxyosW9qVQ9+hgEbGU0 QNCtr+Y17k1aiDfowSwgZOi4U5erZrK0oLhaIbGMGKwr2nraRnPIFwCLEAm9oHHDkXz1 yV6CEVc2xTzoRR/FOwG4rN9vYJgeQWbrOizTGVADzTTQEYbHy0i4hpHpRvabGbv1DMHT NCjc/6UcrS6AJ8SIIYHN7Q1nWAkAaZMnXoZNOb6osGioS0aZs9jpY91GKwnQgFoZivJm ZUezgu16x1LQawOJVrx4Ml6a9IljRpCp0PyRIvNU06iIp+BjV9YQuGSH9gYMK7QnxZjG yhsg== 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:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=p1QyYdwBgvFYQyBj8Qb1wr2hQLoOQFRNbrgZZRyRUGo=; b=VL0T2j50KjOvopV2r0Je7GdBJQT+q0KoyPd2yVVYyjX/emy/1IWShGDJ6I1EuCAh9n X709IbcF3WmSZ56R2idBRFxemtO6xM95742UJ97KxY2+YOodcdSPm9Jw6q6VNtIqiNWd tAmGYVHudz9EFRHmdQFS4YiIYDSn5yjYOFhbRGjFL7weJszA+ylWp+Q2zrEQ6FT6aPI/ ykwZ0ULj9OEkBcmR8d5+j5FYNV6h7n0JwjVIpKz8pHzs1Lh90V+8iHnn+VhWI9CicMJ0 MPEGdkpXVU5WWc9HN+1wePqgTa/ORj/juQzpefKrsY069OkumkqgFExsCC2Olmwpmyt2 QD0w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 77si19915569oie.10.2019.12.29.06.52.16; Sun, 29 Dec 2019 06:52:32 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726543AbfL2OuM (ORCPT + 99 others); Sun, 29 Dec 2019 09:50:12 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:45667 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726230AbfL2OuM (ORCPT ); Sun, 29 Dec 2019 09:50:12 -0500 Received: from callcc.thunk.org (96-72-102-169-static.hfc.comcastbusiness.net [96.72.102.169] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id xBTEn4GM024237 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 29 Dec 2019 09:49:05 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 83EFA420485; Sun, 29 Dec 2019 09:49:04 -0500 (EST) Date: Sun, 29 Dec 2019 09:49:04 -0500 From: "Theodore Y. Ts'o" To: Andy Lutomirski Cc: Stephan Mueller , LKML , Linux API , Kees Cook , "Jason A. Donenfeld" , "Ahmed S. Darwish" , Lennart Poettering , "Eric W. Biederman" , "Alexander E. Patrakov" , Michael Kerrisk , Willy Tarreau , Matthew Garrett , Ext4 Developers List , linux-man Subject: Re: [PATCH v3 0/8] Rework random blocking Message-ID: <20191229144904.GB7177@mit.edu> References: <20191226140423.GB3158@mit.edu> <4048434.Q8HajmOrkZ@tauon.chronox.de> <20191227130436.GC70060@mit.edu> <15817620.rmTN4T87Wr@tauon.chronox.de> <20191227220857.GD70060@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Dec 27, 2019 at 06:06:56PM -0800, Andy Lutomirski wrote: > > I'm thinking of having a real class device and chardev for each hwrng > device. Authentication is entirely in userspace: whatever user code > is involved can look at the sysfs hierarchy and decide to what extent > it trusts a given source. This could be done based on bus topology or > based on anything else. Yes, that's what I was thinking. Another project on my "when I can get a round tuit" list is to change how drivers/char/random.c taps into the hwrng devices, mixing in a bit from each of these devies in a round-robin fashion, instead of just feeding from a single hwrng. > The kernel could also separately expose various noise sources, and the > user code can do whatever it wants with them. But these should be > explicitly unconditioned, un-entropy-extracted sources -- user code > can run its favorite algorithm to extract something it believes to be > useful. The only conceptually tricky bit is keeping user code like > this from interfering with the in-kernel RNG. The other problem is the unconditioned values of the noise sources may leak unacceptable amounts of information about system operation. The most obvious example of this would be keyboard and mouse sources, where today we mix in not only the timing information, but the actual input values (e.g., the keyboard scancodes) into the entropy pool. Exposing this to userspace, even if it is via a privileged system call, would be... unwise. - Ted