All of lore.kernel.org
 help / color / mirror / Atom feed
* [petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org: TPM2 erroring-out after tpm: Factor out common startup code]
@ 2016-08-29 20:08 Jason Gunthorpe
       [not found] ` <20160829200828.GB3201-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2016-08-29 20:08 UTC (permalink / raw)
  To: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Looks legit to me.

----- Forwarded message from Petr Vandrovec <petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> -----

Date: Sat, 27 Aug 2016 23:44:46 -0700
From: Petr Vandrovec <petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
To: jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Subject: TPM2 erroring-out after tpm: Factor out common startup code

Hi Jason,
  your change cae8b441fc20812d7260dc3b45e05ee98fcfff1b to factor out common
startup code introduced regression in tpm2-cmd :-(  Now if firmware does
initialize tpm2 (and so tpm2_do_selftest succeeds), 'TPM self test failed'
error message is still printed, despite 'rc' being zero :-(

Can you apply something like patch below, and send it to Linus?

You also probably want to keep warning that TPM was not initialized by
firmware if tpm2-cmd has to perform initialization, as in such case TPM cannot
be used for attestation.
					Thanks,
						Petr


Do not print error message on successful TPM2 selftest

If TPM2 selftest succeeds, everything is fine, and no error message
should be printed.

Signed-off-by: Petr Vandrovec <petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>


diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index 08c7e23..f141357 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -957,7 +957,7 @@ int tpm2_auto_startup(struct tpm_chip *chip)
                goto out;

        rc = tpm2_do_selftest(chip);
-       if (rc != TPM2_RC_INITIALIZE) {
+       if (rc && rc != TPM2_RC_INITIALIZE) {
                dev_err(&chip->dev, "TPM self test failed\n");
                goto out;
        }

----- End forwarded message -----

-- 
Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>        (780)4406067x832
Chief Technology Officer, Obsidian Research Corp         Edmonton, Canada

------------------------------------------------------------------------------

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

* Re: [petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org: TPM2 erroring-out after tpm: Factor out common startup code]
       [not found] ` <20160829200828.GB3201-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-08-29 20:21   ` Jarkko Sakkinen
       [not found]     ` <20160829202126.GA6780-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jarkko Sakkinen @ 2016-08-29 20:21 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Mon, Aug 29, 2016 at 02:08:28PM -0600, Jason Gunthorpe wrote:
> Looks legit to me.

I think this is a good change as long as it is sent through the
normal process (so that it is available in patchwork).

/Jarkko

> ----- Forwarded message from Petr Vandrovec <petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> -----
> 
> Date: Sat, 27 Aug 2016 23:44:46 -0700
> From: Petr Vandrovec <petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
> To: jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
> Subject: TPM2 erroring-out after tpm: Factor out common startup code
> 
> Hi Jason,
>   your change cae8b441fc20812d7260dc3b45e05ee98fcfff1b to factor out common
> startup code introduced regression in tpm2-cmd :-(  Now if firmware does
> initialize tpm2 (and so tpm2_do_selftest succeeds), 'TPM self test failed'
> error message is still printed, despite 'rc' being zero :-(
> 
> Can you apply something like patch below, and send it to Linus?
> 
> You also probably want to keep warning that TPM was not initialized by
> firmware if tpm2-cmd has to perform initialization, as in such case TPM cannot
> be used for attestation.
> 					Thanks,
> 						Petr
> 
> 
> Do not print error message on successful TPM2 selftest
> 
> If TPM2 selftest succeeds, everything is fine, and no error message
> should be printed.
> 
> Signed-off-by: Petr Vandrovec <petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
> 
> 
> diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
> index 08c7e23..f141357 100644
> --- a/drivers/char/tpm/tpm2-cmd.c
> +++ b/drivers/char/tpm/tpm2-cmd.c
> @@ -957,7 +957,7 @@ int tpm2_auto_startup(struct tpm_chip *chip)
>                 goto out;
> 
>         rc = tpm2_do_selftest(chip);
> -       if (rc != TPM2_RC_INITIALIZE) {
> +       if (rc && rc != TPM2_RC_INITIALIZE) {
>                 dev_err(&chip->dev, "TPM self test failed\n");
>                 goto out;
>         }
> 
> ----- End forwarded message -----
> 
> -- 
> Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>        (780)4406067x832
> Chief Technology Officer, Obsidian Research Corp         Edmonton, Canada
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> tpmdd-devel mailing list
> tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

------------------------------------------------------------------------------

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

* Re: [petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org: TPM2 erroring-out after tpm: Factor out common startup code]
       [not found]     ` <20160829202126.GA6780-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2016-08-29 20:38       ` Jason Gunthorpe
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2016-08-29 20:38 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Mon, Aug 29, 2016 at 11:21:26PM +0300, Jarkko Sakkinen wrote:
> On Mon, Aug 29, 2016 at 02:08:28PM -0600, Jason Gunthorpe wrote:
> > Looks legit to me.
> 
> I think this is a good change as long as it is sent through the
> normal process (so that it is available in patchwork).

I'll send a patch, do your test systems show a bug? It looks like it
is just a scary kernel message?

Jason

------------------------------------------------------------------------------

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

end of thread, other threads:[~2016-08-29 20:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-29 20:08 [petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org: TPM2 erroring-out after tpm: Factor out common startup code] Jason Gunthorpe
     [not found] ` <20160829200828.GB3201-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-08-29 20:21   ` Jarkko Sakkinen
     [not found]     ` <20160829202126.GA6780-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-08-29 20:38       ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.