linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
@ 2022-11-11 19:38 Michael Kelley
  2022-11-12 19:32 ` Winkler, Tomas
  2022-11-27 16:38 ` Jarkko Sakkinen
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Kelley @ 2022-11-11 19:38 UTC (permalink / raw)
  To: peterhuewe, jarkko, jgg, tomas.winkler, linux-integrity, linux-kernel
  Cc: mikelley

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@microsoft.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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
  2022-11-11 19:38 [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality() Michael Kelley
@ 2022-11-12 19:32 ` Winkler, Tomas
  2022-11-22 16:23   ` Michael Kelley (LINUX)
  2022-11-27 16:38 ` Jarkko Sakkinen
  1 sibling, 1 reply; 7+ messages in thread
From: Winkler, Tomas @ 2022-11-12 19:32 UTC (permalink / raw)
  To: Michael Kelley, peterhuewe, jarkko, jgg, linux-integrity, linux-kernel



> -----Original Message-----
> From: Michael Kelley <mikelley@microsoft.com>
> Sent: Friday, November 11, 2022 21:39
> To: peterhuewe@gmx.de; jarkko@kernel.org; jgg@ziepe.ca; Winkler, Tomas
> <tomas.winkler@intel.com>; linux-integrity@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Cc: mikelley@microsoft.com
> Subject: [PATCH 1/1] tpm/tpm_crb: Fix error message in
> __crb_relinquish_locality()
> 
> 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@microsoft.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
  2022-11-12 19:32 ` Winkler, Tomas
@ 2022-11-22 16:23   ` Michael Kelley (LINUX)
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Kelley (LINUX) @ 2022-11-22 16:23 UTC (permalink / raw)
  To: Winkler, Tomas, peterhuewe, jarkko, jgg, linux-integrity, linux-kernel

From: Winkler, Tomas <tomas.winkler@intel.com> Sent: Saturday, November 12, 2022 11:33 AM
> > -----Original Message-----
> > From: Michael Kelley <mikelley@microsoft.com>
> > Sent: Friday, November 11, 2022 21:39
> > To: peterhuewe@gmx.de; jarkko@kernel.org; jgg@ziepe.ca; Winkler, Tomas
> > <tomas.winkler@intel.com>; linux-integrity@vger.kernel.org; linux-
> > kernel@vger.kernel.org
> > Cc: mikelley@microsoft.com
> > Subject: [PATCH 1/1] tpm/tpm_crb: Fix error message in
> > __crb_relinquish_locality()
> >
> > 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@microsoft.com>
> Acked-by: Tomas Winkler <tomas.winkler@intel.com>

Is there a maintainer who can pick up this fix?  It's not time critical; I'm
just trying to make sure it doesn't get lost.

Thanks,

Michael

> 
> > ---
> >  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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
  2022-11-11 19:38 [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality() Michael Kelley
  2022-11-12 19:32 ` Winkler, Tomas
@ 2022-11-27 16:38 ` Jarkko Sakkinen
  2022-11-29  4:34   ` Michael Kelley (LINUX)
  1 sibling, 1 reply; 7+ messages in thread
From: Jarkko Sakkinen @ 2022-11-27 16:38 UTC (permalink / raw)
  To: Michael Kelley
  Cc: peterhuewe, jgg, tomas.winkler, linux-integrity, linux-kernel

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@microsoft.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.

BR, Jarkko

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
  2022-11-27 16:38 ` Jarkko Sakkinen
@ 2022-11-29  4:34   ` Michael Kelley (LINUX)
  2022-12-04 19:51     ` Jarkko Sakkinen
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Kelley (LINUX) @ 2022-11-29  4:34 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: peterhuewe, jgg, tomas.winkler, linux-integrity, linux-kernel

From: Jarkko Sakkinen <jarkko@kernel.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@microsoft.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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
  2022-11-29  4:34   ` Michael Kelley (LINUX)
@ 2022-12-04 19:51     ` Jarkko Sakkinen
  2022-12-04 19:53       ` Jarkko Sakkinen
  0 siblings, 1 reply; 7+ messages in thread
From: Jarkko Sakkinen @ 2022-12-04 19:51 UTC (permalink / raw)
  To: Michael Kelley (LINUX)
  Cc: peterhuewe, jgg, tomas.winkler, linux-integrity, linux-kernel

On Tue, Nov 29, 2022 at 04:34:09AM +0000, Michael Kelley (LINUX) wrote:
> From: Jarkko Sakkinen <jarkko@kernel.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@microsoft.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."

I misread the callback name, when I first looked into this (in
too much rush). You're absolutely correct.

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
  2022-12-04 19:51     ` Jarkko Sakkinen
@ 2022-12-04 19:53       ` Jarkko Sakkinen
  0 siblings, 0 replies; 7+ messages in thread
From: Jarkko Sakkinen @ 2022-12-04 19:53 UTC (permalink / raw)
  To: Michael Kelley (LINUX)
  Cc: peterhuewe, jgg, tomas.winkler, linux-integrity, linux-kernel

On Sun, Dec 04, 2022 at 07:51:20PM +0000, Jarkko Sakkinen wrote:
> On Tue, Nov 29, 2022 at 04:34:09AM +0000, Michael Kelley (LINUX) wrote:
> > From: Jarkko Sakkinen <jarkko@kernel.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@microsoft.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."
> 
> I misread the callback name, when I first looked into this (in
> too much rush). You're absolutely correct.
> 
> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

Applied to git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git

BR, Jarkko

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-04 19:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11 19:38 [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality() Michael Kelley
2022-11-12 19:32 ` Winkler, Tomas
2022-11-22 16:23   ` Michael Kelley (LINUX)
2022-11-27 16:38 ` Jarkko Sakkinen
2022-11-29  4:34   ` Michael Kelley (LINUX)
2022-12-04 19:51     ` Jarkko Sakkinen
2022-12-04 19:53       ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).