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.8 required=3.0 tests=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 387A8C2D0CE for ; Sun, 29 Dec 2019 14:50:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 180CE20718 for ; Sun, 29 Dec 2019 14:50:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726575AbfL2OuM (ORCPT ); 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