[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR21MB1688C889A9EC7773EAC2CA0AD7129@BYAPR21MB1688.namprd21.prod.outlook.com>
Date: Tue, 29 Nov 2022 04:34:09 +0000
From: "Michael Kelley (LINUX)" <mikelley@...rosoft.com>
To: Jarkko Sakkinen <jarkko@...nel.org>
CC: "peterhuewe@....de" <peterhuewe@....de>,
"jgg@...pe.ca" <jgg@...pe.ca>,
"tomas.winkler@...el.com" <tomas.winkler@...el.com>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/1] tpm/tpm_crb: Fix error message in
__crb_relinquish_locality()
From: Jarkko Sakkinen <jarkko@...nel.org> Sent: Sunday, November 27, 2022 8:39 AM
>
> On Fri, Nov 11, 2022 at 11:38:53AM -0800, Michael Kelley wrote:
> > The error message in __crb_relinquish_locality() mentions requestAccess
> > instead of Relinquish. Fix it.
> >
> > Fixes: 888d867df441 ("tpm: cmd_ready command can be issued only after granting locality")
> > Signed-off-by: Michael Kelley <mikelley@...rosoft.com>
> > ---
> > drivers/char/tpm/tpm_crb.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
> > index 1860665..65f8f17 100644
> > --- a/drivers/char/tpm/tpm_crb.c
> > +++ b/drivers/char/tpm/tpm_crb.c
> > @@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev,
> > iowrite32(CRB_LOC_CTRL_RELINQUISH, &priv->regs_h->loc_ctrl);
> > if (!crb_wait_for_reg_32(&priv->regs_h->loc_state, mask, value,
> > TPM2_TIMEOUT_C)) {
> > - dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed out\n");
> > + dev_warn(dev, "TPM_LOC_STATE_x.Relinquish timed out\n");
> > return -ETIME;
> > }
> >
> > --
> > 1.8.3.1
> >
>
> Please explain.
>
There are two parallel functions: __crb_request_locality() and
__crb_relinquish_locality(). In the current code, both return the
same text in the error message if a timeout occurs. That
error message seems appropriate for __crb_request_locality()
since it is setting the "requestAccess" bit.
But the error message seems inappropriate for
__crb_relinquish_locality(), which is setting the "Relinquish" bit.
So the patch changes the error message to indicate that the
timeout occurred in setting the Relinquish bit.
I'm looking at Section 6.5.3.2.2.1 in the TCG PC Client Platform
TPM Profile Specification for TPM 2.0, Version 1.05 Revision 14.
This is where the "requestAccess" and "Relinquish" bits are defined.
Or maybe I am not understanding what you are getting at with
"Please explain."
Michael
Powered by blists - more mailing lists