Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp11622223ybl; Fri, 27 Dec 2019 18:07:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxdysIzfkNgfTqEk/M5k+SBqw8UyhOlmYTrylYyv4Cc+fAfBuIzJb6v51g8guEgYL4Lr5oO X-Received: by 2002:a05:6830:22e3:: with SMTP id t3mr57078222otc.193.1577498871858; Fri, 27 Dec 2019 18:07:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577498871; cv=none; d=google.com; s=arc-20160816; b=B1QBIlKwc+kFMov8Zdxu4sij0Zymwdvj0vhQdqxsz4FfMFGEmGr4AHncx+YANATTW5 GyhLgM7YlC4RaGYCm84TIJ3/8Zup9QdWLl4r2I+5WgU/iY845im5z2KsTB4lHL1QjHig DAQjpJdELzO6BCnzPy0B7Sm9bALXbjg83lmjSZfiiXgaHSW6WIEIxRDUhLCIuHT+0IAW nl9AQqnku1TohxLW4jEfgtwAqjehHeSslL4ddArEqQDJ9A+3YFFz2YH8LCzo1GW/WAxA Za1bN8M2SZeaXLGkujtk8bL3vPHXBauk1NKlX1ck+VKFjRw4AKd+cVT7iyaXgHojKp4d aSEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rQ9xCPZYWih4mP007phL9vl3O8NTtFnWNjLlxynnK1Y=; b=pNzN6taYUUvOSqR9bG2zhXL7Coe8uD1JNx5yr3UgyjQqlEXZ/N4ES6m1qzG9AXSKXt Cd2/xmHab/oPfWm06p+/P6j2/AcQcHCTYtVKkEs/ucgYHLESz6+zJck6bqrqgz5sEbCt 1J9J9cyW/ZK+TrATeZzfhFNbLi8HoXrhyp089ZYEAiGMmvG5JoU1EKXdIPMM4R0/Kwor S+HsaBrvqUXNtbKRFkF8VaCsfa/lQ40etb3HRzongPifJ9ULeJ5oLcN29ls4RY6Zdhs4 aaIjgUULYNbED4crRHIRdC6UNAf3aIZIpg9FwSY7Mu1NjndxPyG+nyE1PncnD2hgodV9 qmBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1c6ghWj9; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si17199667oii.249.2019.12.27.18.07.25; Fri, 27 Dec 2019 18:07:51 -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; dkim=pass header.i=@kernel.org header.s=default header.b=1c6ghWj9; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbfL1CHO (ORCPT + 99 others); Fri, 27 Dec 2019 21:07:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:41368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbfL1CHO (ORCPT ); Fri, 27 Dec 2019 21:07:14 -0500 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89275222C2 for ; Sat, 28 Dec 2019 02:07:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577498833; bh=U/nAnG2hJ81tt6C4DRheFtDEpu00ZrtqXVwbAsZZP9M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=1c6ghWj9lBinB1rJ06SZnLd56bVBBBe9bPlVBfLZzT9lOViU8sgKn5WWYaCABTVCU mV7JlPuz2lmd9hnM4J1CtbAGqIFv9gcLmZftS+0Wi0uiScZE3GN7E8NGM/yYR0L1wd RGzetWX/uhSMgeHn4e0hXigTRJ7NGS4dE6kAfqv4= Received: by mail-wm1-f49.google.com with SMTP id p9so9498141wmc.2 for ; Fri, 27 Dec 2019 18:07:13 -0800 (PST) X-Gm-Message-State: APjAAAXcN0qDYItA2rgyVZCVcGSmaXxxS1FRTiKIojNv7oaDWXtKxuHQ +ev7WV8AFPdl3cZP+319+5u7z5QfTnsH/QypeD/K/Q== X-Received: by 2002:a7b:cbc9:: with SMTP id n9mr21666330wmi.89.1577498831945; Fri, 27 Dec 2019 18:07:11 -0800 (PST) MIME-Version: 1.0 References: <20191226140423.GB3158@mit.edu> <4048434.Q8HajmOrkZ@tauon.chronox.de> <20191227130436.GC70060@mit.edu> <15817620.rmTN4T87Wr@tauon.chronox.de> <20191227220857.GD70060@mit.edu> In-Reply-To: <20191227220857.GD70060@mit.edu> From: Andy Lutomirski Date: Fri, 27 Dec 2019 18:06:56 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 0/8] Rework random blocking To: "Theodore Y. Ts'o" Cc: Stephan Mueller , Andy Lutomirski , 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 Content-Type: text/plain; charset="UTF-8" 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 2:09 PM Theodore Y. Ts'o wrote: > So if it's just for cryptographers, then let it all be done in > userspace, and let's not make it easy for GPG, OpenSSL, etc., to all > say, "We want TrueRandom(tm); we won't settle for less". We can talk > about how do we provide the interfaces so that those cryptographers > can get the information they need so they can get access to the raw > noise sources, separated out and named, and with possibly some way > that the noise source can authenticate itself to the Cryptographer's > userspace library/application. > > But all of this should probably not be in drivers/char/random.c, and > we probably need to figure out a better kernel to userspace interface > than what we have with /dev/hwrng. 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. 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. --Andy