[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <446cf9c70184885e4cec6dd4514ae8daf7accdcb.camel@HansenPartnership.com>
Date: Sat, 02 Nov 2024 11:04:38 -0500
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: "Daniel P. Smith" <dpsmith@...rtussolutions.com>, Andy Lutomirski
<luto@...capital.net>
Cc: Thomas Gleixner <tglx@...utronix.de>, "Eric W. Biederman"
<ebiederm@...ssion.com>, Eric Biggers <ebiggers@...nel.org>, Ross Philipson
<ross.philipson@...cle.com>, linux-kernel@...r.kernel.org, x86@...nel.org,
linux-integrity@...r.kernel.org, linux-doc@...r.kernel.org,
linux-crypto@...r.kernel.org, kexec@...ts.infradead.org,
linux-efi@...r.kernel.org, iommu@...ts.linux-foundation.org,
mingo@...hat.com, bp@...en8.de, hpa@...or.com,
dave.hansen@...ux.intel.com, ardb@...nel.org, mjg59@...f.ucam.org,
peterhuewe@....de, jarkko@...nel.org, jgg@...pe.ca, nivedita@...m.mit.edu,
herbert@...dor.apana.org.au, davem@...emloft.net, corbet@....net,
dwmw2@...radead.org, baolu.lu@...ux.intel.com, kanth.ghatraju@...cle.com,
andrew.cooper3@...rix.com, trenchboot-devel@...glegroups.com
Subject: Re: [PATCH v9 06/19] x86: Add early SHA-1 support for Secure Launch
early measurements
On Sat, 2024-11-02 at 10:53 -0400, Daniel P. Smith wrote:
> Hi Luto,
>
> My apologies, I missed this response and the active on v11 cause me
> to
> get an inquiry why I hadn't responded.
>
> On 9/21/24 18:40, Andy Lutomirski wrote:
[...]
> > I assumed that "deliberately cap" meant that there was an actual
> > feature where you write something to the event log (if applicable)
> > and extend the PCR in a special way that *turns that PCR off*.
> > That is, it does something such that later-loaded software *can't*
> > use that PCR to attest or unseal anything, etc.
> >
> > But it sounds like you're saying that no such feature exists. And
> > a quick skim of the specs doesn't come up with anything. And the
> > SHA1 banks may well be susceptible to a collision attack.
>
> Correct, the only entity that can disable PCR banks is the firmware.
No, that's not correct. Any user can use TPM_PCR_Allocate to activate
or deactivate individual banks. The caveat is the change is not
implemented until the next TPM reset (which should involve a reboot).
BIOS also gets to the TPM before the kernel does, so it can, in theory,
check what banks a TPM has and call TPM_PCR_Allocate to change them.
In practice, because this requires a reboot, this is usually only done
from the BIOS menus not on a direct boot ... so you can be reasonably
sure that whatever changes were made will stick.
> When it initializes the TPM, it can disable banks/algorithms. After
> that, when an extend operation is done, the TPM is expecting an entry
> for all active PCR banks and the TPM itself does the extend hash that
> is stored into the PCRs.
This, also, is not quite correct: an extend is allowed to specify banks
that don't exist (in which case nothing happens and no error is
reported) and miss banks that do (in which case no extend is done to
that bank). In the early days of TPM2, some BIOS implementations only
extended sha1 for instance, meaning the sha256 banks were all zero when
the kernel started.
Even today, if you activate a bank the BIOS doesn't know about, it
likely won't extend it. You can see this in VM boots with OVMF and
software TPMs having esoteric banks like SM3.
Regards,
James
Powered by blists - more mailing lists