Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3039456lqz; Wed, 3 Apr 2024 16:56:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/arK1d5Ocm9EJfFXKqE7YL0fqCz9Eyuvl2iFcAsTNe3rh/M07EkhLW0xER1+qfWvkfeDwpkCWSCF8oxad/WA8ITWk2kZDDKQOhW+9fg== X-Google-Smtp-Source: AGHT+IHGRvD2zKMjcEj6BfxJuxWaRdrQANa0Lq0zSJfWITL4RTSZeCpicuvX3XxfAzF4tlP3T6Yg X-Received: by 2002:a05:6870:1851:b0:22e:7ae3:bf6f with SMTP id u17-20020a056870185100b0022e7ae3bf6fmr864523oaf.45.1712188615504; Wed, 03 Apr 2024 16:56:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712188615; cv=pass; d=google.com; s=arc-20160816; b=eOcLdaXOopCRcDBfOTHhrKAjpUXWL3lxG24T5+lXi6np2utiEgNwx0Aup04c1h4pYY pQdC0Gq+TBByPqzna+sFuqzcpEE1eXg85/P8H/eQ6QVrsxGvvB8h05Feoc2SFc0zz7Cl td/+N8ql1YLCW7SOKsV9GXHVzdHoFb5oQ1WeHRj4hagXhwOINmMk1r09Js0bSiGsGA8L FcG/mihkgmMYzLIJcUCS1HLwE7i+awNzZ6+WzKaB3fOCUmoYJVXVTpmUZN96aOF+q+yX 3xq6mJGKgxvhCV6yzr76iS1ZrsVK0m1OuWmsbtijK7GJRdw45GMVkDXus7wL8In8vXmi 414g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ioJVGNAx1vNrQcqwvwgV0OAzN5G4cxw+QpwDcRLELzY=; fh=xtZLwEUU/D7+EQBYTpQiGWuts9fH8iouutNlAuxqRmA=; b=SOla6+GY3huE6iXganOVsPVuvao8WzDMdGVX4/WTDod2WVUh8ft+wllCdnOk3xzg3M R1X5z1iJt5TvvrtISkR4pBl/0M6yZ52OYTF5c4kTF8M+oU+R3A6Wj0kvGpwXuZV7pAEY 1mtY9yfeVyzTjsw2ucZkDUu5O/E63ipRy7YkYJBVnzSp/257b+yEpVw6BxIPHskDXkTF O4Nb4TmwpyoWPUvLSIBDf4C50ohhReZw7wv0TPDeRtaRLgjWZ8txjKprAj/MV7xuIh42 +zvzFku9LPe0yHooFzT56nh4H2FkluyOX/Zd+UU9u0oXXYGRk5MC37wNcekAa66CQ5gD E92Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t0uM6RPl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-130756-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130756-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r24-20020a63e518000000b005dc080c3e7csi14245165pgh.86.2024.04.03.16.56.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 16:56:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130756-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t0uM6RPl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-130756-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130756-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F0F7928A661 for ; Wed, 3 Apr 2024 23:56:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2F7C156C7B; Wed, 3 Apr 2024 23:56:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t0uM6RPl" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF2B1139D; Wed, 3 Apr 2024 23:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712188600; cv=none; b=t4YlS2vr1XPL2zMn0LrgHZaodZOU+ikvsBqDBBUUJEB6k/aOiM4GKkdbQz9B+0ejt+RW+ZoWrw30153bNWpSqI/aVZY/oZkenGghlzfJAydmHdrfgApiWXgQZusrrwj8qLJPYYdokhgvSySefnbD0wpPQgyPw1ccg9OFXTU+xPE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712188600; c=relaxed/simple; bh=m8IbDM148A6sz7bWT/CQKnE9AfgQW6cHCi6VsGmG9X8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ja2EYn79rSXqeiXD8lb9opfNjasjFMdcLr5dPjCSGvanpoTHNHBh0SDtXG3KYad5lTzVi1fK5HsWdpvfAjRYMdZKzTToxQCEWkX2TD6IREq1bgwad7NZM32Ep4Ae6xAHntXQVaCHj0C1MySAMsnkaFx10UXmXu7A3RVOJhglTAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t0uM6RPl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3407C43394; Wed, 3 Apr 2024 23:56:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712188599; bh=m8IbDM148A6sz7bWT/CQKnE9AfgQW6cHCi6VsGmG9X8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t0uM6RPlGuNQ2pvlqrK5sJYW3QIWUD/Ch+blAKlhtyKQCglZyMACwH2YghM8qdYTx eBPDOQhbls3SLnnU19e+ycW267im0qo3s7DmQrGBThEtcKMITPijTtYT1j6u19QNnf amG33e6JWYAg2/i6QR7pitO2x0BsQI9uWn5IiKeG944GH9LkfL4L21VdoeIIgHiyBQ gpoc8t9p9dMFVRKVRDB1eJL2fMFGmILWoJ6R8tS5FM1x1fnZGWHEyoc/jXW7wXeoSu PNyqc9GIixNFegy1D6HYuzxTwLjegR0bNGA4RUOTulmhCHilEkh1v3G/QSiOKtNKIT UfoXU+7DHB84Q== Date: Wed, 3 Apr 2024 18:56:35 -0500 From: Eric Biggers To: Andy Lutomirski Cc: Andrew Cooper , Ard Biesheuvel , Ross Philipson , Linux Kernel Mailing List , the arch/x86 maintainers , linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, Linux Crypto Mailing List , kexec@lists.infradead.org, linux-efi@vger.kernel.org, dpsmith@apertussolutions.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Dave Hansen , Matthew Garrett , James.Bottomley@hansenpartnership.com, peterhuewe@gmx.de, jarkko@kernel.org, Jason Gunthorpe , "luto@amacapital.net" , Arvind Sankar , Herbert Xu , davem@davemloft.net, kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com Subject: Re: [PATCH v8 06/15] x86: Add early SHA support for Secure Launch early measurements Message-ID: <20240403235635.GA24248@quark.localdomain> References: <98ad92bb-ef17-4c15-88ba-252db2a2e738@citrix.com> <1a8e69a7-89eb-4d36-94d6-0da662d8b72f@citrix.com> <431a0b3a-47e5-4e61-a7fc-31cdf56f4e4c@citrix.com> <20240223175449.GA1112@sol.localdomain> <20240223183004.GE1112@sol.localdomain> <10db421c-77da-4a1c-a25e-2374a7a2ef79@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <10db421c-77da-4a1c-a25e-2374a7a2ef79@app.fastmail.com> On Wed, Apr 03, 2024 at 09:32:02AM -0700, Andy Lutomirski wrote: > On Fri, Feb 23, 2024, at 10:30 AM, Eric Biggers wrote: > > On Fri, Feb 23, 2024 at 06:20:27PM +0000, Andrew Cooper wrote: > >> On 23/02/2024 5:54 pm, Eric Biggers wrote: > >> > On Fri, Feb 23, 2024 at 04:42:11PM +0000, Andrew Cooper wrote: > >> >> Yes, and I agree.? We're not looking to try and force this in with > >> >> underhand tactics. > >> >> > >> >> But a blind "nack to any SHA-1" is similarly damaging in the opposite > >> >> direction. > >> >> > >> > Well, reviewers have said they'd prefer that SHA-1 not be included and given > >> > some thoughtful reasons for that. But also they've given suggestions on how to > >> > make the SHA-1 support more palatable, such as splitting it into a separate > >> > patch and giving it a proper justification. > >> > > >> > All suggestions have been ignored. > >> > >> The public record demonstrates otherwise. > >> > >> But are you saying that you'd be happy if the commit message read > >> something more like: > >> > >> ---8<--- > >> For better or worse, Secure Launch needs SHA-1 and SHA-256. > >> > >> The choice of hashes used lie with the platform firmware, not with > >> software, and is often outside of the users control. > >> > >> Even if we'd prefer to use SHA-256-only, if firmware elected to start us > >> with the SHA-1 and SHA-256 backs active, we still need SHA-1 to parse > >> the TPM event log thus far, and deliberately cap the SHA-1 PCRs in order > >> to safely use SHA-256 for everything else. > >> --- > > > > Please take some time to read through the comments that reviewers have left on > > previous versions of the patchset. > > So I went and read through the old comments, and I'm lost. In brief summary: > > If the hardware+firmware only supports SHA-1, then some reviewers would prefer > Linux not to support DRTM. I personally think this is a bit silly, but it's > not entirely unreasonable. Maybe it should be a config option? > > If the hardware+firmware does support SHA-256, then it sounds (to me, reading > this -- I haven't dug into the right spec pages) that, for optimal security, > something still needs to effectively turn SHA-1 *off* at runtime by capping > the event log properly. And that requires computing a SHA-1 hash. And, to be > clear, (a) this is only on systems that already support SHA-256 and that we > should support and (b) *not* doing so leaves us potentially more vulnerable to > SHA-1 attacks than doing so. And no SHA-256-supporting tooling will actually > be compromised by a SHA-1 compromise if we cap the event log. > > So is there a way forward? Just saying "read through the comments" seems like > a dead end. > It seems there may be a justification for some form of SHA-1 support in this feature. As I've said, the problem is that it's not explained in the patchset itself. Rather, it just talks about "SHA" and pretends like SHA-1 and SHA-2 are basically the same. In fact, SHA-1 differs drastically from SHA-2 in terms of security. SHA-1 support should be added in a separate patch, with a clearly explained rationale *in the patch itself* for the SHA-1 support *specifically*. - Eric