From: Jarkko Sakkinen <jarkko@kernel.org>
To: Borys Movchan <borysmn@axis.com>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
kernel@axis.com, linux-integrity@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] tpm: Add Upgrade/Reduced mode support for TPM2 modules
Date: Thu, 5 Aug 2021 23:52:45 +0300 [thread overview]
Message-ID: <20210805205245.qcdqcuog7zmsp7j5@kernel.org> (raw)
In-Reply-To: <20210804162132.24786-1-borysmn@axis.com>
On Wed, Aug 04, 2021 at 06:21:31PM +0200, Borys Movchan wrote:
> If something went wrong during the TPM firmware upgrade, like power
> failure or the firmware image file get corrupted, the TPM might end
> up in Upgrade or Failure mode upon the next start. The state is
> persistent between the TPM power cycle/restart.
>
> According to TPM specification:
> * If the TPM is in Upgrade mode, it will answer with TPM2_RC_UPGRADE
> to all commands except Field Upgrade related ones.
> * If the TPM is in Failure mode, it will allow performing TPM
> initialization but will not provide any crypto operations.
> Will happily respond to Field Upgrade calls.
>
> The fix changes the behavior of the `tpm2_auto_startup` function, so
In commit messages, you ought to use imperative form:
"Change the behaviour of tpm2_auto_startup(), ..."
> it tries to detect what mode TPM is running in. If the chip is in the
> Upgrade or Failure mode, the function returns -EIO error code which
> can be used later to adjust driver behavior later.
*How* tpm2_auto_startup() detects the mode?
> After `tpm_chip_register` calls `tpm2_auto_startup` it checks for the
Please remove all these hyphens. They make the commit message a pain
to read. E.g. instead write tpm_chip_register(). This is not Github.
> error code. If the TPM is in Upgrade or Failure mode, set the
> `limited_mode` flag. The calls to `tpm2_get_cc_attrs_tbl`,
> `tpm_add_hwrng` and `tpm_get_pcr_allocation` will fail if the TPM is
> in Failure or Upgrade mode, so use `limited_mode` flag to exclude
> them from the module initialization sequence.
>
> Signed-off-by: Borys Movchan <borysmn@axis.com>
> ---
>
> Notes:
> Commit message updated
v2:
* Commit message updated.
Notes would be something that had existed already in the first version.
Here we want a simple change log.
/Jarkko
next prev parent reply other threads:[~2021-08-05 20:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 16:21 [PATCH v3] tpm: Add Upgrade/Reduced mode support for TPM2 modules Borys Movchan
2021-08-05 20:52 ` Jarkko Sakkinen [this message]
2021-08-06 14:20 ` Borys Movchan
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=20210805205245.qcdqcuog7zmsp7j5@kernel.org \
--to=jarkko@kernel.org \
--cc=borysmn@axis.com \
--cc=jgg@ziepe.ca \
--cc=kernel@axis.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
/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).