From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org: TPM2 erroring-out after tpm: Factor out common startup code]
Date: Mon, 29 Aug 2016 14:08:28 -0600 [thread overview]
Message-ID: <20160829200828.GB3201@obsidianresearch.com> (raw)
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
------------------------------------------------------------------------------
next reply other threads:[~2016-08-29 20:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-29 20:08 Jason Gunthorpe [this message]
[not found] ` <20160829200828.GB3201-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-08-29 20:21 ` [petr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org: TPM2 erroring-out after tpm: Factor out common startup code] Jarkko Sakkinen
[not found] ` <20160829202126.GA6780-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-08-29 20:38 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160829200828.GB3201@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).