Received: by 10.192.165.156 with SMTP id m28csp1736049imm; Tue, 17 Apr 2018 04:48:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Wi71Uqv2is1ambSVNZfyKSQ8cyq1DsCz3xlyDqB6iTzeOtdtSTacrUw+qlABWdtVIRsAm X-Received: by 10.101.92.68 with SMTP id v4mr1463425pgr.30.1523965737059; Tue, 17 Apr 2018 04:48:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523965737; cv=none; d=google.com; s=arc-20160816; b=f8FRu31T/y9nOYPV70Q0O5FkguGRXD+HKLiDn8QMaKTSTLE+16zMjEnYAxBlSlyLwB AHchU9gO7+hYhKnLh/mWfIIv6vpv69oIj/cPUNinbx+JrvJI+cSapbCkIWsUr+FObpPh z03FVlJMRHSGWuNUdXKtYXSgvjESXntdcMVUzaQeh9aYO4oCpwSLB4XV/svXSHh6FEtC o/UcV/XQiiyzPzaDV7IAubx8Vv5m30ug1K68W5wEEVRBreZ09pL2QzezDmVLFhBZjWb7 nIzFN06Xf71FQLE4FLkOs9+Xzwqk2sR/tcm7PA6m6Faai7Yda47hdpxoi9jRSwBGbRGh 97KQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=yoEJm5NCxRTpULAJXDD7uR0XFQ44MijB4cBJyXx3FB4=; b=aLHH4MLB05Fta7yj2MqQ6yXdnupzWGyMRsI5D3V3JiclQSjjG9+IT4ww3dMnbSaSUp gOvxppVtGGMBkUTXmTaBBfolm/6U/loyfZKeoBDrYtxu0ZTHhHLmh5iYYfKRM0yKQcv3 DSV5H1vXoAWOBZhwT4H2x+DF+Kkj81BbXK3k2ofh7EZG4fQ+wQiTL89/UdSE21lTwjZp RxReSfQR13mgAFJqlchpFREJL97uQyYg6CLzxLFkw80P5TMC1hbb1/r/Qy/XMoVAKydW c4iAYge4h+GzkUgUe0hSFc3JzSncbL/LNaoNST/2q/p9/2jccB8kFcmWy4vN7S+MBsb1 PwJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=p/ODllMm; 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 b10-v6si14685009pla.260.2018.04.17.04.48.42; Tue, 17 Apr 2018 04:48:57 -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=@infradead.org header.s=bombadil.20170209 header.b=p/ODllMm; 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 S1752732AbeDQLra (ORCPT + 99 others); Tue, 17 Apr 2018 07:47:30 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53250 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752357AbeDQLr3 (ORCPT ); Tue, 17 Apr 2018 07:47:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To: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=yoEJm5NCxRTpULAJXDD7uR0XFQ44MijB4cBJyXx3FB4=; b=p/ODllMmO0GFOvO75kAE8dc+h3 X937OxtjmN221q/jsIPVKRFrbVXm+V9kxava72YUf91LeRmeBvaA6DelaEkNvURsWhUBj1C4n4vLn Aqbj/0Z2jQoEj1M2CTg4359+w5UBYEGcQ5D686/jFeOSAs2Tczpy+B+7bd02JINxsYlHlQFDTAb/g A+v5YfnsizORPOi2HHjEOD5yeWeGT2xqRa7ffBUDZ0JNAMm5aG3fRSZId5jX4fXNidGOy8/4oAl+F M20RW2htx+Jiy/niBhUrK+p9BlwAlBuWfrM6n4BaPqIi+sScYxIHuOutH6/nj299wgKWg4X9NEaSu T8o/LHiQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8P56-0000uH-EL; Tue, 17 Apr 2018 11:47:28 +0000 Date: Tue, 17 Apr 2018 04:47:28 -0700 From: Matthew Wilcox To: James Bottomley Cc: "Theodore Y. Ts'o" , Alexey Dobriyan , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: repeatable boot randomness inside KVM guest Message-ID: <20180417114728.GA21954@bombadil.infradead.org> References: <20180414195921.GA10437@avx2> <20180414224419.GA21830@thunk.org> <20180415004134.GB15294@bombadil.infradead.org> <1523956414.3250.5.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1523956414.3250.5.camel@HansenPartnership.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 17, 2018 at 10:13:34AM +0100, James Bottomley wrote: > On Sat, 2018-04-14 at 17:41 -0700, Matthew Wilcox wrote: > > On Sat, Apr 14, 2018 at 06:44:19PM -0400, Theodore Y. Ts'o wrote: > > > What needs to happen is freelist should get randomized much later > > > in the boot sequence.??Doing it later will require locking; I don't > > > know enough about the slab/slub code to know whether the slab_mutex > > > would be sufficient, or some other lock might need to be added. > > > > Could we have the bootloader pass in some initial randomness? > > Where would the bootloader get it from (securely) that the kernel > can't? In this particular case, qemu is booting the kernel, so it can apply to /dev/random for some entropy. > For example, if you compile in a TPM driver, the kernel will > pick up 32 random entropy bytes from the TPM to seed the pool, but I > think it happens too late to help with this problem currently. IMA > also needs the TPM very early in the boot sequence, so I was wondering > about using the initial EFI driver, which is present on boot, and then > transitioning to the proper kernel TPM driver later, which would mean > we could seed the pool earlier. > > As long as you mix it properly and limit the amount, it shouldn't > necessarily be a source of actual compromise, but having an external > input to our cryptographically secure entropy pool is an additional > potential attack vector. I thought our model was that if somebody had compromised the bootloader, all bets were off. And also that we were free to mix in as many untrustworthy bytes of alleged entropy into the random pool as we liked.