linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borys Movchan <borysmn@axis.com>
To: Jarkko Sakkinen <jarkko@kernel.org>,
	Borys Movchan <Borys.Movchan@axis.com>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	kernel <kernel@axis.com>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] tpm: Add Upgrade/Reduced mode support for TPM2 modules
Date: Fri, 6 Aug 2021 16:20:56 +0200	[thread overview]
Message-ID: <d6cd1eb6-48b5-c1ad-e063-a26bc7509d95@axis.com> (raw)
In-Reply-To: <20210805205245.qcdqcuog7zmsp7j5@kernel.org>


On 8/5/21 10:52 PM, Jarkko Sakkinen wrote:
> 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(), ..."
>
Done
>> 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?
Done
>> 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.
Done
>> 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.
Corrected
> /Jarkko
>

Kind regards,

Borys


      reply	other threads:[~2021-08-06 14:18 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
2021-08-06 14:20   ` Borys Movchan [this message]

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=d6cd1eb6-48b5-c1ad-e063-a26bc7509d95@axis.com \
    --to=borysmn@axis.com \
    --cc=Borys.Movchan@axis.com \
    --cc=jarkko@kernel.org \
    --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).