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.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 A7617C49ED7 for ; Fri, 20 Sep 2019 13:13:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7AC18205F4 for ; Fri, 20 Sep 2019 13:13:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726109AbfITNNR (ORCPT ); Fri, 20 Sep 2019 09:13:17 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:52448 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725842AbfITNNR (ORCPT ); Fri, 20 Sep 2019 09:13:17 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-98.corp.google.com [104.133.0.98] (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 x8KDDAT5018281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Sep 2019 09:13:10 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id D5A52420811; Fri, 20 Sep 2019 09:13:09 -0400 (EDT) Date: Fri, 20 Sep 2019 09:13:09 -0400 From: "Theodore Y. Ts'o" To: Linus Torvalds Cc: "Ahmed S. Darwish" , Lennart Poettering , "Eric W. Biederman" , "Alexander E. Patrakov" , Michael Kerrisk , lkml , linux-ext4@vger.kernel.org, linux-man@vger.kernel.org Subject: Re: [PATCH RFC v4 1/1] random: WARN on large getrandom() waits and introduce getrandom2() Message-ID: <20190920131309.GB16111@mit.edu> References: <20190914122500.GA1425@darwi-home-pc> <008f17bc-102b-e762-a17c-e2766d48f515@gmail.com> <20190915052242.GG19710@mit.edu> <20190918211503.GA1808@darwi-home-pc> <20190918211713.GA2225@darwi-home-pc> <20190919143427.GQ6762@mit.edu> 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-man-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org On Thu, Sep 19, 2019 at 08:50:15AM -0700, Linus Torvalds wrote: > .. btw, instead of bad workarounds for a theoretical attack, here's > something that should add actual *practical* real value: use the time > of day (whether from an RTC device, or from ntp) to add noise to the > random pool. Actally, we used to seed the pool from the RTC device --- that was the case in the 3.4 kernel referenced by the Blackhat attack, and it didn't stop the researchers. In later kernels, we moved up when rand_initialized() got called to before time_init(), so init_std_data() was no longer seeding the pool from the RTC clock. That being said, adding calls to add_device_randomness() to do_settimeofday64() and timekeeping_inject_offset() is an obviously good thing to do. I'll prepare a separate patch for the random.git tree to do that. - Ted