From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Roberto Sassu <roberto.sassu@huawei.com>
Cc: zohar@linux.ibm.com, david.safford@ge.com, monty.wiseman@ge.com,
matthewgarrett@google.com, linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org, keyrings@vger.kernel.org,
linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com
Subject: Re: [PATCH v9 1/6] tpm: dynamically allocate the allocated_banks array
Date: Fri, 01 Feb 2019 13:34:51 +0000 [thread overview]
Message-ID: <20190201133451.GA17861@linux.intel.com> (raw)
In-Reply-To: <20190201100641.26936-2-roberto.sassu@huawei.com>
On Fri, Feb 01, 2019 at 11:06:36AM +0100, Roberto Sassu wrote:
> This patch renames active_banks (member of tpm_chip) to allocated_banks,
> stores the number of allocated PCR banks in nr_allocated_banks (new member
> of tpm_chip), and replaces the static array with a pointer to a dynamically
> allocated array.
>
> tpm2_get_pcr_allocation() determines if a PCR bank is allocated by checking
> the mask in the TPML_PCR_SELECTION structure returned by the TPM for
> TPM2_Get_Capability(). If a bank is not allocated, the TPM returns that
> bank in TPML_PCR_SELECTION, with all bits in the mask set to zero. In this
> case, the bank is not included in chip->allocated_banks, to avoid that TPM
> driver users unnecessarily calculate a digest for that bank.
>
> One PCR bank with algorithm set to SHA1 is always allocated for TPM 1.x.
>
> As a consequence of the introduction of nr_allocated_banks,
> tpm_pcr_extend() does not check anymore if the algorithm stored in tpm_chip
> is equal to zero.
>
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
/Jarkko
WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Roberto Sassu <roberto.sassu@huawei.com>
Cc: zohar@linux.ibm.com, david.safford@ge.com, monty.wiseman@ge.com,
matthewgarrett@google.com, linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org, keyrings@vger.kernel.org,
linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com
Subject: Re: [PATCH v9 1/6] tpm: dynamically allocate the allocated_banks array
Date: Fri, 1 Feb 2019 15:34:51 +0200 [thread overview]
Message-ID: <20190201133451.GA17861@linux.intel.com> (raw)
In-Reply-To: <20190201100641.26936-2-roberto.sassu@huawei.com>
On Fri, Feb 01, 2019 at 11:06:36AM +0100, Roberto Sassu wrote:
> This patch renames active_banks (member of tpm_chip) to allocated_banks,
> stores the number of allocated PCR banks in nr_allocated_banks (new member
> of tpm_chip), and replaces the static array with a pointer to a dynamically
> allocated array.
>
> tpm2_get_pcr_allocation() determines if a PCR bank is allocated by checking
> the mask in the TPML_PCR_SELECTION structure returned by the TPM for
> TPM2_Get_Capability(). If a bank is not allocated, the TPM returns that
> bank in TPML_PCR_SELECTION, with all bits in the mask set to zero. In this
> case, the bank is not included in chip->allocated_banks, to avoid that TPM
> driver users unnecessarily calculate a digest for that bank.
>
> One PCR bank with algorithm set to SHA1 is always allocated for TPM 1.x.
>
> As a consequence of the introduction of nr_allocated_banks,
> tpm_pcr_extend() does not check anymore if the algorithm stored in tpm_chip
> is equal to zero.
>
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
/Jarkko
next prev parent reply other threads:[~2019-02-01 13:34 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-01 10:06 [PATCH v9 0/6] tpm: retrieve digest size of unknown algorithms from TPM Roberto Sassu
2019-02-01 10:06 ` Roberto Sassu
2019-02-01 10:06 ` [PATCH v9 1/6] tpm: dynamically allocate the allocated_banks array Roberto Sassu
2019-02-01 10:06 ` Roberto Sassu
2019-02-01 13:34 ` Jarkko Sakkinen [this message]
2019-02-01 13:34 ` Jarkko Sakkinen
2019-02-01 10:06 ` [PATCH v9 2/6] tpm: rename and export tpm2_digest and tpm2_algorithms Roberto Sassu
2019-02-01 10:06 ` Roberto Sassu
2019-02-01 13:36 ` Jarkko Sakkinen
2019-02-01 13:36 ` Jarkko Sakkinen
2019-02-01 10:06 ` [PATCH v9 3/6] tpm: retrieve digest size of unknown algorithms with PCR read Roberto Sassu
2019-02-01 10:06 ` Roberto Sassu
2019-02-01 10:06 ` [PATCH v9 4/6] tpm: move tpm_chip definition to include/linux/tpm.h Roberto Sassu
2019-02-01 10:06 ` Roberto Sassu
2019-02-01 13:38 ` Jarkko Sakkinen
2019-02-01 13:38 ` Jarkko Sakkinen
2019-02-04 8:58 ` kbuild test robot
2019-02-04 8:58 ` kbuild test robot
2019-02-01 10:06 ` [PATCH v9 5/6] KEYS: trusted: explicitly use tpm_chip structure from tpm_default_chip() Roberto Sassu
2019-02-01 10:06 ` Roberto Sassu
2019-02-01 13:39 ` Jarkko Sakkinen
2019-02-01 13:39 ` Jarkko Sakkinen
2019-02-01 10:06 ` [PATCH v9 6/6] tpm: pass an array of tpm_extend_digest structures to tpm_pcr_extend() Roberto Sassu
2019-02-01 10:06 ` Roberto Sassu
2019-02-01 13:39 ` Jarkko Sakkinen
2019-02-01 13:39 ` Jarkko Sakkinen
2019-02-01 13:41 ` Jarkko Sakkinen
2019-02-01 13:41 ` Jarkko Sakkinen
2019-02-01 14:33 ` Mimi Zohar
2019-02-01 14:33 ` Mimi Zohar
2019-02-01 17:33 ` Jarkko Sakkinen
2019-02-01 17:33 ` Jarkko Sakkinen
2019-02-01 17:42 ` Jarkko Sakkinen
2019-02-01 17:42 ` Jarkko Sakkinen
2019-02-01 19:15 ` Mimi Zohar
2019-02-01 19:15 ` Mimi Zohar
2019-02-04 9:14 ` Roberto Sassu
2019-02-04 9:14 ` Roberto Sassu
2019-02-04 12:07 ` Jarkko Sakkinen
2019-02-04 12:07 ` Jarkko Sakkinen
2019-02-04 12:59 ` Mimi Zohar
2019-02-04 12:59 ` Mimi Zohar
2019-02-04 13:21 ` Roberto Sassu
2019-02-04 13:21 ` Roberto Sassu
2019-02-04 23:26 ` Jarkko Sakkinen
2019-02-04 23:26 ` Jarkko Sakkinen
2019-02-04 23:30 ` Jarkko Sakkinen
2019-02-04 23:30 ` Jarkko Sakkinen
2019-02-05 10:02 ` Roberto Sassu
2019-02-05 10:02 ` Roberto Sassu
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=20190201133451.GA17861@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=david.safford@ge.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=matthewgarrett@google.com \
--cc=monty.wiseman@ge.com \
--cc=roberto.sassu@huawei.com \
--cc=silviu.vlasceanu@huawei.com \
--cc=zohar@linux.ibm.com \
/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 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.