Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3737321imm; Thu, 17 May 2018 13:54:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrfEA5jmarO9lUYL3ierqXqWGZHKFh8cnTHdUVAHpH1wzoMA/hJwAUjtfEDl32usoOzbUEg X-Received: by 2002:a17:902:710f:: with SMTP id a15-v6mr6763747pll.171.1526590479564; Thu, 17 May 2018 13:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526590479; cv=none; d=google.com; s=arc-20160816; b=XaAP8PhPZzNc4haAAHAycejl/WTgu/WJztSFKNKesusMWZaDIcETw2YRxLyAv1FkMB 8KaA1OaArMEd68f5Pfsulm7icVdf3Gw/WG3tX0agrzfV2YDdrS9jtRlo6tS1hm68O+Bk qLtKvitXSjfLi125iW4QHBI7og6GSVUXuPy/QW/r469FNydWMiH4tZ00Z2aHIHn6ytka f+vMwU477bKZ2JKKBemP7jkJlgwo85oIm8S+oiLxIw+ajtaQGAvmMjKu3iREviMiI6nl i1I1UteBGTVTLlTIFKw/ogPRu0KP8onAnwsDu0+TU2PDHU/eFCWqoX+8H1EGJTwUVGb8 GSUQ== 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=ql57pX44jJXQ5wuEENReXwCx3+/tKBLq3nOSM7rhQXo=; b=xD3Pa8v3AH6DI4R830lfAmlfl3+Sbvv1VkS9WpA3U7EFmOixtwhqZAnAmLMXiBx0qx fwE2zqO20Qx+joJzCWMaPFCS/hjZ4rhVoUN4CfFHGPX9yI/06UgxQm9zNDF5mUkyg/7i jKI2TdiYwSjoQzROvT0/tzGW+P7sG4twUDstzq6hDDvcmi9iSBtZp63rY69K65q9V+4F m7SqLonFuoTMrf5kwQJLXXiqRMjeC61gLF6/WSCpHwLXz5XT9JgEwaAfgs09yFpOmhPB CfuhDKXUO6vxPozd/r+7sZG+5YxrtbYXuFKHHlrP5I3THo5XBSH7P9/D7DqTWQCCa0Aq fosQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=ZCmJHATG; 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 t2-v6si5903718plz.27.2018.05.17.13.54.25; Thu, 17 May 2018 13:54:39 -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=ZCmJHATG; 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 S1752336AbeEQUxx (ORCPT + 99 others); Thu, 17 May 2018 16:53:53 -0400 Received: from imap.thunk.org ([74.207.234.97]:46276 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752174AbeEQUxd (ORCPT ); Thu, 17 May 2018 16:53:33 -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=ql57pX44jJXQ5wuEENReXwCx3+/tKBLq3nOSM7rhQXo=; b=ZCmJHATGpdw3gnQSNYf2yaQv8y 97an9DFhZ7O1lcLkqiOIeknwQlCmBLb4m5Z5HCBw/Sk+yD84AYmglxMUyrcJaysISX092YMnDTXTP iueRFotwBIc5pUw6hCz+IN3NaVFydiO0d9eo2wfKiEPxFHdmBgi5EG98N6ZIGmapXLTE=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1fJPtw-0000ZE-2X; Thu, 17 May 2018 20:53:28 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 4E7CB7A5990; Thu, 17 May 2018 16:53:27 -0400 (EDT) Date: Thu, 17 May 2018 16:53:27 -0400 From: "Theodore Y. Ts'o" To: "Srivatsa S. Bhat" Cc: Stephan Mueller , linux-crypto@vger.kernel.org, Linux Kernel Developers List , rostedt@goodmis.org Subject: Re: [PATCH 1/5] random: fix crng_ready() test Message-ID: <20180517205327.GB15263@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , "Srivatsa S. Bhat" , Stephan Mueller , linux-crypto@vger.kernel.org, Linux Kernel Developers List , rostedt@goodmis.org References: <20180413013046.404-1-tytso@mit.edu> <1699469.KmO53oa8XU@tauon.chronox.de> <20180413125313.GA2633@thunk.org> <4393662.RPWnPK42dp@tauon.chronox.de> <20180413170037.GA28721@thunk.org> <6bb4d4cb-aafa-7440-0dc3-40faf647ec89@csail.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6bb4d4cb-aafa-7440-0dc3-40faf647ec89@csail.mit.edu> 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 Wed, May 16, 2018 at 05:07:08PM -0700, Srivatsa S. Bhat wrote: > > On a Photon OS VM running on VMware ESXi, this patch causes a boot speed > regression of 5 minutes :-( [ The VM doesn't have haveged or rng-tools > (rngd) installed. ] > > [ 1.420246] EXT4-fs (sda2): re-mounted. Opts: barrier,noacl,data=ordered > [ 1.469722] tsc: Refined TSC clocksource calibration: 1900.002 MHz > [ 1.470707] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x36c65c1a9e1, max_idle_ns: 881590695311 ns > [ 1.474249] clocksource: Switched to clocksource tsc > [ 1.584427] systemd-journald[216]: Received request to flush runtime journal from PID 1 > [ 346.620718] random: crng init done > > Interestingly, the boot delay is exacerbated on VMs with large amounts > of RAM. For example, the delay is not so noticeable (< 30 seconds) on a > VM with 2GB memory, but goes up to 5 minutes on an 8GB VM. > > Also, cloud-init-local.service seems to be the one blocking for entropy > here. So the first thing I'd ask you to investigate is what the heck cloud-init-local.service is doing, and why it really needs cryptographic grade random numbers? > It would be great if this CVE can be fixed somehow without causing boot speed > to spuike from ~20 seconds to 5 minutes, as that makes the system pretty much > unusable. I can workaround this by installing haveged, but ideally an in-kernel > fix would be better. If you need any other info about my setup or if you have > a patch that I can test, please let me know! So the question is why is strong random numbers needed by cloud-init-local, and how much do you trust either haveged and/or RDRAND (which is what you will be depending upon if you install rng-tools). If you believe that Intel and/or the NSA hasn't backdoored RDRAND[1], or you believe that because Intel processor's internal cache architecture isn't publically documented, and it's Soooooooo complicated that no one can figure it out (which is what you will be depending upon if you if you choose haveged), be my guest. I personally consider the latter to be "security via obscu7rity", but others have different opinions. [1] As an aside, read the best paper from the 37th IEEE Symposium on Security and Privacy and weep: https://www.computerworld.com/article/3079417/security/researchers-built-devious-undetectable-hardware-level-backdoor-in-computer-chips.html If it turns out that the security if your VM is critically dependent on what cloud-init-local.service is doing, and you don't like making those assumptions, then you may need to ask VMWare ESXi to make virtio-rng available to guest OS's, and then make Photon OS depend on a secure RNG available to the host OS. Best regards, - Ted