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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 E44FEC3A59F for ; Thu, 29 Aug 2019 15:47:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C54B521726 for ; Thu, 29 Aug 2019 15:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728188AbfH2Pro (ORCPT ); Thu, 29 Aug 2019 11:47:44 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:59761 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726283AbfH2Pro (ORCPT ); Thu, 29 Aug 2019 11:47:44 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-111.corp.google.com [104.133.0.111] (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 x7TFj59e005976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Aug 2019 11:45:07 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 3F15242049E; Thu, 29 Aug 2019 11:45:05 -0400 (EDT) Date: Thu, 29 Aug 2019 11:45:05 -0400 From: "Theodore Y. Ts'o" To: Hsin-Yi Wang Cc: Kees Cook , Stephen Boyd , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Russell King , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , "Paul E . McKenney" , Kate Stewart , "David S . Miller" , Viresh Kumar , Marek Szyprowski , Arnd Bergmann , Marc Zyngier , Julien Thierry , Greg Kroah-Hartman , Wei Li , Anders Roxell , Rob Herring , Aaro Koskinen , Daniel Thompson , Tim Chen , Rik van Riel , Waiman Long , Marcelo Tosatti , Peter Zijlstra , Armijn Hemel , Grzegorz Halat , Len Brown , Shaokun Zhang , Mike Rapoport , Guenter Roeck , Andrew Morton , Mathieu Desnoyers , Alexey Dobriyan , Yury Norov , Josh Poimboeuf , Jiri Kosina , Mukesh Ojha , lkml Subject: Re: [PATCH v9 2/3] fdt: add support for rng-seed Message-ID: <20190829154505.GB10779@mit.edu> Mail-Followup-To: "Theodore Y. Ts'o" , Hsin-Yi Wang , Kees Cook , Stephen Boyd , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Russell King , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , "Paul E . McKenney" , Kate Stewart , "David S . Miller" , Viresh Kumar , Marek Szyprowski , Arnd Bergmann , Marc Zyngier , Julien Thierry , Greg Kroah-Hartman , Wei Li , Anders Roxell , Rob Herring , Aaro Koskinen , Daniel Thompson , Tim Chen , Rik van Riel , Waiman Long , Marcelo Tosatti , Peter Zijlstra , Armijn Hemel , Grzegorz Halat , Len Brown , Shaokun Zhang , Mike Rapoport , Guenter Roeck , Andrew Morton , Mathieu Desnoyers , Alexey Dobriyan , Yury Norov , Josh Poimboeuf , Jiri Kosina , Mukesh Ojha , lkml References: <20190822071522.143986-1-hsinyi@chromium.org> <20190822071522.143986-3-hsinyi@chromium.org> <5d5ed368.1c69fb81.419fc.0803@mx.google.com> <201908241203.92CC0BE8@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 29, 2019 at 06:03:57PM +0800, Hsin-Yi Wang wrote: > On Thu, Aug 29, 2019 at 1:36 AM Kees Cook wrote: > > > > Can this please be a boot param (with the default controlled by the > > CONFIG)? See how CONFIG_RANDOM_TRUST_CPU is wired up... > > > > Currently rng-seed read and added in setup_arch() --> > setup_machine_fdt().. -> early_init_dt_scan_chosen(), which is earlier > than parse_early_param() that initializes early_param. > > If we want to set it as a boot param, add_bootloader_randomness() can > only be called after parse_early_param(). The seed can't be directly > added to pool after it's read in. We need to store into global > variable and load it later. > If this seems okay then I'll add a patch for this. Thanks I thought about asking for this, but we really want to do this as early as possible, so that it can be used by KASLR and other services that are run super early. Also, whether or not we can trust the bootloader is going to be a system-level thing. This should probably be defaulted to off, and only enabled by the system integrator if they are 100%, positively sure, that the entire system is one where we can trust the source of randomness which the bootloader is using --- or for that matter, that the bootloader is trustworthy! Is it really going to be that useful for a random system administrator to be able to flip this on or off from the command line? Hopefully there will be an easy way to configure the firmware or the bootloader to simply not supply entropy, if for some reason it's not trustworthy. - Ted