Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2036013imm; Sat, 4 Aug 2018 17:27:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdMVzvTluxujZIScxvZHAATdUTtQXc/uEo6qsno/R3WEbeoZZg0O4PUhgOqzwlsj96aci+7 X-Received: by 2002:a17:902:b60e:: with SMTP id b14-v6mr6500322pls.111.1533428829412; Sat, 04 Aug 2018 17:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533428829; cv=none; d=google.com; s=arc-20160816; b=f/ZSC8awC9cJcTQPVosSvSJIBOOtDF92fSCIlXSA8UuqTVbQqqA/Ywo9T6cd5WLECK MKDwO/FzO4M+u9W3Mt+J7B06OwJF64AF4Fvr1my7ppUcpuODIDhjDPQ5aQOwScBbU9d+ P5Gl4oMvBYJgn1LzBbWJ8zHLfIbFzGQedVU3+LBqFwqm8NLcJQBLtQD7rZ9aazQ7gmM3 BZaMI/0RMzbho/w1CamJuY9to53lvaRlu1S1sNfMLcafnVX0rU46B3R/nDORAbj5oT/q nLrVvnQn2vOlxEVURbrua8L9QxAR1tTHf2YtqQz/3g4YA/hNRs2RUChV2+Q+D3t5d9YP faLQ== 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=Q8ozgmkh9c8xVgW7uiByxVshDeymBAogAUyM2T9RMvg=; b=Ms+r8OFD9SwyI3hfcKIDPsPpEFxS+JadKGpuW2dVD65a6DTdX5pstHtpqrgQS2wfjG KXve0vq98+dADtSDzRCAOnMej9d1mtlFetQUnZ/fshrWhXsR1fhC6C/uynFLgowFeeDP 29hqx2QyttbmHkazs8XCP53yWTTBQsIjN2gj1OnpFstJsiYwdvH5Qf7N5z54HyZVbV9E EE7+x955qNBWgPiFifnR45gUZ+g342Ymy+DKjn2cApZHShu90zo+4yC9Cur4s0Z+fRpd 7GRu1SHgbBvl7JWMIVP4j5+dHVPgk/Qmdo7LQD7fjx8fG1ByZ2Haf0xiK/rxC6ia+c4h gY7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=MZd7WZ4g; 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 v12-v6si6401143plz.105.2018.08.04.17.26.54; Sat, 04 Aug 2018 17:27:09 -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=MZd7WZ4g; 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 S1730185AbeHEC1y (ORCPT + 99 others); Sat, 4 Aug 2018 22:27:54 -0400 Received: from imap.thunk.org ([74.207.234.97]:38146 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726961AbeHEC1y (ORCPT ); Sat, 4 Aug 2018 22:27:54 -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=Q8ozgmkh9c8xVgW7uiByxVshDeymBAogAUyM2T9RMvg=; b=MZd7WZ4gLYBwE9bvRdk/4EMUig eCgC7fkuGGcGf8DXs7o0AjIpqBQh79JUQ6ciZe9OyTw4ocPqGHb5kdivE0r3MOgov+qV3AsFHIGrv EUreLU11s95yMGPYDK6taNYWbjtdbz7KRN38K3ZX5ePZ6+CW0R3OXiRBS04fSTWuYXZw=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1fm6rD-0003Op-9Y; Sun, 05 Aug 2018 00:25:15 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 59ED07A64C9; Sat, 4 Aug 2018 20:25:14 -0400 (EDT) Date: Sat, 4 Aug 2018 20:25:14 -0400 From: "Theodore Y. Ts'o" To: Pavel Machek Cc: Yann Droneaud , linux-crypto@vger.kernel.org, Linux Kernel Developers List , labbott@redhat.com Subject: Re: [PATCH] random: add a config option to trust the CPU's hwrng Message-ID: <20180805002514.GF4461@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Pavel Machek , Yann Droneaud , linux-crypto@vger.kernel.org, Linux Kernel Developers List , labbott@redhat.com References: <20180718014344.1309-1-tytso@mit.edu> <37046662f2b38f98854abfa1b5868a27c3fa0888.camel@opteya.com> <20180718142625.GA5942@thunk.org> <20180804215209.GA3201@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180804215209.GA3201@localhost> User-Agent: Mutt/1.10.1 (2018-07-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 Sat, Aug 04, 2018 at 11:52:10PM +0200, Pavel Machek wrote: > > However, enabling config option means that the CRNG will be > > initialized with potentially information available to the CPU > > manufacturer and/or Nation States, and this persists *after* > > initialization / early boot. So to say, "we're perfectly safe after > > we leave initialization / early boot" is not true. > > This should really be explained in the help text. > > I assume that after 10 seconds of moving mouse, user is safe even when > rdrand is backoored? You'll hate this answer, but "it depends". Suppose someone is using an init script which generates ssh keys upon first boot if they are missing. If this is the case, *and* RDRAND is backdoored, then the keys will be generated in such a way that they *might* be succeptible to being guessed by a nation state. Moving your mouse around for 1000 or 10,000 seconds won't help if the host's ssh keys has already been generated. Depending on your hardware, no mouse motion might be necessary at all. On my laptop (a Dell XPS 13 model 9370) using an dm-crypt protected root disk, and running a Debian testing userspace, with a 4.18-rc6 based kernel, the "CRNG is initialized" message is printed *before* the root file system is mounted. On other systems, where the hardware does not issue as many interrupts, the mouse motion might be extremely important in order to get the "CRNG is initialized" message. > (Plus, I'd say this should be kernel command line option, not config > option...?) Agreed, there should be a command line option as well. I just haven't gotten around to it yet, and in the meantime, having a config option is better than nothing. Patches gratefully accepted... :-) - Ted