From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 63A563D974 for ; Mon, 13 Nov 2023 23:21:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="R9KN89sY" Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79C99D6B for ; Mon, 13 Nov 2023 15:21:39 -0800 (PST) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2c7420d5a83so63146131fa.0 for ; Mon, 13 Nov 2023 15:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1699917698; x=1700522498; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=16UHKTiJBBdygB3NDxQg1vSNAYLocg/Q+/o22+Gc4VM=; b=R9KN89sYoE/N+duK+AjQhl/datsRFFG727K85SuRqRCpk5GBNF3O2E93GBmTu2fnJr +FK1vMXBhkd15On5TCWykOBIlaTS/bAzi2yLbkSVVOIQFUZUVSTScm2sCw9GELBWc6RG z4pxSclCXjU2xCEK0+/AFs+ClfPCRZPUhvThY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699917698; x=1700522498; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=16UHKTiJBBdygB3NDxQg1vSNAYLocg/Q+/o22+Gc4VM=; b=rcubCVT8UcmT/ud5txnDJO38JOwH3+uteeafmnghPnplkk2QZFLlvTxgvOtKRddd8n WqrCvZAe13tyKhn4gqWZpQbf+kuUJn6mIqUgHSUKawfk17E7LyHv1U6/f7kcxItstbb6 h/oY5XsJsxRxBOuQLfHNipRErWCLnZfgKZfK62IMum3g91MfzSAdsKOfx5Q6N2TZ3VIV 1e0biH/PWIL/No/a7dEa/Hbr0KSlf5yIYSfX/CIJHDZt3ra6zYpohJNrd3Q9ita8g7r8 03hX1JqtE9+uCadhj0OE0coIG9ZqZ50KX4CNSjbsl3e7X/tfIxeuTRjTcwh56onHRGyo TlAw== X-Gm-Message-State: AOJu0YxQ2KSbindXrWQm0DInFi0T/Mqq9j3RWE1Tsj808GytEedGsU3p bQqt7lZ+wD3LfHs47XitdGWO+g== X-Google-Smtp-Source: AGHT+IEFbywTuiCM3Qsf46VdvQGP+jWzn8QiLDib6v40aY/R+2Y0qrS+3M5SUqyMVbx0tvNqsu2OdA== X-Received: by 2002:a2e:3602:0:b0:2c5:623:aa01 with SMTP id d2-20020a2e3602000000b002c50623aa01mr436845lja.49.1699917697666; Mon, 13 Nov 2023 15:21:37 -0800 (PST) Received: from [172.25.82.51] ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id v4-20020ac87284000000b0041eef6cacf4sm2262161qto.81.2023.11.13.15.21.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Nov 2023 15:21:37 -0800 (PST) Message-ID: <8703f1a9-5d4d-4c5a-b9aa-3b31ad2dcd41@citrix.com> Date: Mon, 13 Nov 2023 23:21:36 +0000 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 06/13] x86: Add early SHA support for Secure Launch early measurements Content-Language: en-GB To: James Bottomley , Eric Biggers , Ross Philipson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, kexec@lists.infradead.org, linux-efi@vger.kernel.org, dpsmith@apertussolutions.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, ardb@kernel.org, mjg59@srcf.ucam.org, luto@amacapital.net, nivedita@alum.mit.edu, kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com References: <20231110222751.219836-1-ross.philipson@oracle.com> <20231110222751.219836-7-ross.philipson@oracle.com> <20231111174435.GA998@sol.localdomain> <87f56530b85ea894036a74be1824d6f2716f70de.camel@HansenPartnership.com> From: Andrew Cooper Autocrypt: addr=andrew.cooper3@citrix.com; keydata= xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8c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TC/7tvG3euCklmkn9Sl9IAKFu29RSo d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs 6+ahAA== In-Reply-To: <87f56530b85ea894036a74be1824d6f2716f70de.camel@HansenPartnership.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 11/11/2023 8:36 pm, James Bottomley wrote: > On Sat, 2023-11-11 at 18:19 +0000, Andrew Cooper wrote: >> On 11/11/2023 5:44 pm, Eric Biggers wrote: >>> On Fri, Nov 10, 2023 at 05:27:44PM -0500, Ross Philipson wrote: >>>>  arch/x86/boot/compressed/early_sha1.c   | 12 ++++ >>>>  lib/crypto/sha1.c                       | 81 >>>> +++++++++++++++++++++++++ >>> It's surprising to still see this new use of SHA-1 after so many >>> people objected to it in the v6 patchset.  It's also frustrating >>> that the SHA-1 support is still being obfuscated by being combined >>> in one patch with SHA-2 support, perhaps in an attempt to conflate >>> the two algorithms and avoid having to give a rationale for the >>> inclusion of SHA-1.  Finally, new functions should not be added to >>> lib/crypto/sha1.c unless those functions have multiple users. >> The rational was given.  Let me reiterate it. >> >> There are real TPMs in the world that can't use SHA-2.  The use of >> SHA-1 is necessary to support DRTM on such systems, and there are >> real users of such configurations. > Given that TPM 2.0 has been shipping in bulk since Windows 10 (2015) > and is required for Windows 11 (2021), are there really such huge > numbers of TPM 1.2 systems involved in security functions? Yes. As ever, it's not as simple as a straight TPM version issue. AMD's firmware-TPM2 isn't compatible with their DRTM implementation.  Users are limited to whatever headers are available on the motherboard. Furthermore, even with a TPM2, it is the firmware (Intel TXT ACM) or hardware (AMD SKINIT) which chooses the hash algorithms to use, and in a lot of cases the end user doesn't get a choice. So yes - there really are modern systems which you can't use SHA-2-only with. >> DRTM with SHA-1-only is a damnsight better than no DTRM, even if SHA- >> 1 is getting a little long in the tooth. > That's not the problem. The problem is that sha1 is seen as a > compromised algorithm by NIST which began deprecating it in 2011 and is > now requiring it to be removed from all systems supplied to the US > government by 2030 This is a non-issue. People who care about having no SHA-1 can not compile in DRTM support. But there are people who will tolerate SHA-1 code to get DTRM support. ~Andrew