Received: by 10.192.165.148 with SMTP id m20csp102189imm; Thu, 26 Apr 2018 16:59:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr3nLRZm6c7qU5LBmqtiT2cwAlSNe7thtxPhFElFYmahwhrwYzbJo3cjibWu+FH9eJmy2Fs X-Received: by 2002:a63:7b47:: with SMTP id k7-v6mr77879pgn.321.1524787161210; Thu, 26 Apr 2018 16:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524787161; cv=none; d=google.com; s=arc-20160816; b=kS2XbXd7a+d+ydrfik63c6z3wm6VOS23VZINAnCkoBTyFtgjEdNOXRkoqyDLd0O/Kq FBwDQwhE3oV8di4Sni2/ymXsSJOz3k92DJjRVW2BRomxdxjj3ukKh8bl40A7XYgbH8RC fHTVY/CCyxqfiwIfBEWrV0F9RgSU+Ex/FxgwfqIE6231D5YvBxq7hOTQbuHbPSZzt6jG e3UpWkeSAq8kdjyVak0wc7kptzgS3yx91TYyFyzuV0YpuZQ1IFBNIWLKGODahT40gOez ZI9a60cauhOOnjFWzXxCPwGN3G4hc1LpIc3EF3XekEQFgpGWaJJttuKdQJsEy3pdbKk5 +2uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=KcmHcXrogAXyUu65BKa7UTgBeO5F0M0B3dh9s9i7zPw=; b=0o8mUXH6CYj6XcwX/cjyWWCbwtQdKKxB8pMMKrUuv6RqFC/YQr9u7sTqCvFwvN9anO P8Y+Y9bD2LEVasWTF6pnHu9NBf7CQ1szn4M95RV+Mqo6g1l+Sln3JXHrzIJgW1+mZlcg 6OWTJsmhjwzy3v2eZ+6HfOcKkhFT+AXEIBT7BW2l+OE1ERzXaM5z9Rz5drBk73cxXMcy wMrjHRinhKZX1Epr2uRcw1mfQbA9/76716NOgjna97FWaFbL/2MUqCOL6rgu9UQMPHm1 fVzn8AvQItc4h0EQZWC7NRYY7RZmiOSCJtrMBc3WEVfKajuDDuV1Dj4q9SJ758/kAiwd 86VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=QTe58+fE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 n128-v6si47954pgn.15.2018.04.26.16.59.07; Thu, 26 Apr 2018 16:59:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=QTe58+fE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754317AbeDZX4r (ORCPT + 99 others); Thu, 26 Apr 2018 19:56:47 -0400 Received: from imap.thunk.org ([74.207.234.97]:36160 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbeDZX4q (ORCPT ); Thu, 26 Apr 2018 19:56:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KcmHcXrogAXyUu65BKa7UTgBeO5F0M0B3dh9s9i7zPw=; b=QTe58+fEwy+qUQPaNP89EVF9nj nHqZFxmJA8/yknwrEAn7ptyWoPauF6DWce5Jx7iHIFjXT26CfAguiesN8N0X+cFA3s0r6Oa/Mwq8N bTsfkDvx0zwEVqpDvVOajl1rvVoF4siHPnematdZzrnG6sEE9yeNm34wIHLJlOl0dkcg=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1fBqkl-00023z-33; Thu, 26 Apr 2018 23:56:45 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 9B1A97A0091; Thu, 26 Apr 2018 19:56:30 -0400 (EDT) Date: Thu, 26 Apr 2018 19:56:30 -0400 From: "Theodore Y. Ts'o" To: Sultan Alsawaf Cc: linux-kernel@vger.kernel.org, Jann Horn Subject: Re: Linux messages full of `random: get_random_u32 called from` Message-ID: <20180426235630.GG5965@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Sultan Alsawaf , linux-kernel@vger.kernel.org, Jann Horn References: <20180426050056.GF18803@thunk.org> <20180426073255.GH18803@thunk.org> <20180426192524.GD5965@thunk.org> <2add15cb-2113-0504-a732-81255ea61bf5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2add15cb-2113-0504-a732-81255ea61bf5@gmail.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 26, 2018 at 01:22:02PM -0700, Sultan Alsawaf wrote: > > Also, regardless of what's hanging on CRNG init, CRNG should be able to init on its own in a timely > manner without the need for user-provided entropy. Userspace was working fine before the recent CRNG > kernel changes, so I don't think this is a userspace bug. The CRNG changes were needed because were erroneously saying that the entropy pool was securely initialized before it really was. Saying that CRNG should be able to init on its own is much like saying, "Ted should be able to fly wherever he wants in his own personal Gulfstream V." It would certainly be _nice_ if I could afford my personal jet. I certainly wish I were that rich. But the problem is that dollars (or Euro's) are like entropy, they don't just magically drop out of the sky. If there isn't user-provided entropy, and the hardware isn't providing sufficient entropy, where did you think the kernel is supposed to get the entropy from? Should it dial 1-800-TRUST-NSA? From the dmesg log, you have a Chromebook Acer 14. I'm guessing the problem is that Chromebooks have hardware tries *very* hard not to issue interrupts, since that helps with power savings. The following from your dmesg is very interesting: [ 0.526786] tpm tpm0: [Firmware Bug]: TPM interrupt not working, polling instead I suspect this isn't a firmware bug; it's the hardware working as intended / working as designed, for power savings reasons. So there are two ways to fix this that I can see. One is to try to adjust userspace so that it allows the boot to proceed. As there is more activity, the disk completion interrupts, the user typing their username/password into the login screen, etc., there will be timing events which can be used to harvest entropy. The other approach would be to compile the kernel with CONFIG_HW_RANDOM_TPM and to modify drivers/char/tpm/tpm-chip.c tot initalize chip->hwrng.quality = 500. We've historically made this something that the system administrator must set via sysfs. This is because we wanted system adminisrators to explicitly say that they trust the any hardware manufacturer that (a) they haven't been paid by your choice of the Chinese MSS or the US NSA to introduce a backdoor,i and (b) they are competent to actually implemnt a _secure_ hardware random number generator. Sadly, this has not always been the case. Please see: https://www.chromium.org/chromium-os/tpm_firmware_update And note that your Edgar Chromebook is one the list of devices that have a TPM with the buggy firmware. Fortunately this particular TPM bug only affects RSA prime generation, so as far as I know there is no _known_ vulerability in your TPM's hardware random number generator. B ut we want it to be _your_ responsibility to decide you are willing to truste it. I certainly don't want to be legally liable --- or even have the moral responsibility --- of guaranteeing that every single TPM out there is bug-free(tm). - Ted