Re: [PATCH 1/3] tpm: protect against locality counter underflow

From: Jarkko Sakkinen
Date: Tue Feb 20 2024 - 17:31:36 EST


On Tue Feb 20, 2024 at 10:26 PM UTC, Jarkko Sakkinen wrote:
> On Tue Feb 20, 2024 at 8:54 PM UTC, Lino Sanfilippo wrote:
> > for (i = 0; i <= MAX_LOCALITY; i++)
> > __tpm_tis_relinquish_locality(priv, i);
>
> I'm pretty unfamiliar with Intel TXT so asking a dummy question:
> if Intel TXT uses locality 2 I suppose we should not try to
> relinquish it, or?
>
> AFAIK, we don't have a symbol called MAX_LOCALITY.

OK it was called TPM_MAX_LOCALITY :-) I had the patch set applied
in one branch but looked up with wrong symbol name.

So I reformalize my question to two parts:

1. Why does TXT leave locality 2 open in the first place? I did
not see explanation. Isn't this a bug in TXT?
2. Because localities are not too useful these days given TPM2's
policy mechanism I cannot recall out of top of my head can
you have two localities open at same time. So what kind of
conflict happens when you try to open locality 0 and have
locality 2 open?

BR, Jarkko