linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Roberto Sassu <roberto.sassu@huawei.com>
Cc: Nayna Jain <nayna@linux.ibm.com>,
	zohar@linux.ibm.com, linux-integrity@vger.kernel.org,
	silviu.vlasceanu@huawei.com,
	Kenneth Goldman <kgoldman@us.ibm.com>
Subject: Re: [PATCH] Apply on top of: tpm: dynamically allocate active_banks array
Date: Tue, 13 Nov 2018 17:45:47 +0200	[thread overview]
Message-ID: <20181113154547.GA4601@linux.intel.com> (raw)
In-Reply-To: <82565c56-d3a3-ac15-4345-7e19b90fabf1@huawei.com>

On Tue, Nov 13, 2018 at 10:49:31AM +0100, Roberto Sassu wrote:
> On 11/12/2018 7:09 PM, Nayna Jain wrote:
> > 
> > 
> > On 11/09/2018 02:59 PM, Roberto Sassu wrote:
> > > This patch checks if a PCR bank is active (at least one bit in the
> > > pcr_select mask is set).
> > > ---
> > >   drivers/char/tpm/tpm2-cmd.c | 44 +++++++++++++++++++++++++++----------
> > >   1 file changed, 32 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
> > > index 533089cede07..eba8f8d00a09 100644
> > > --- a/drivers/char/tpm/tpm2-cmd.c
> > > +++ b/drivers/char/tpm/tpm2-cmd.c
> > > @@ -854,15 +854,20 @@ struct tpm2_pcr_selection {
> > >   static ssize_t tpm2_get_pcr_allocation(struct tpm_chip *chip)
> > >   {
> > > -    struct tpm2_pcr_selection pcr_selection;
> > > +    struct tpm2_pcr_selection *pcr_selection;
> > >       struct tpm_buf buf;
> > >       void *marker;
> > >       void *end;
> > >       void *pcr_select_offset;
> > >       u32 sizeof_pcr_selection;
> > > +    u32 nr_possible_banks;
> > > +    u32 nr_active_banks = 0;
> > 
> > The TCG Spec uses the term "allocated" and not "active".  For
> > consistency, I think we can also use the term "allocated". For example -
> > nr_allocated_banks and *allocated_banks both here and in struct
> > tpm_chip.
> > 
> > Sorry, it took me sometime to be clear on this else would have mentioned
> > previously.
> 
> Thanks. Jarkko?
> 
> Roberto

Agree with Nayna.

/Jarkko

      reply	other threads:[~2018-11-13 15:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09  9:29 [PATCH] Apply on top of: tpm: dynamically allocate active_banks array Roberto Sassu
2018-11-12 18:09 ` Nayna Jain
2018-11-13  9:49   ` Roberto Sassu
2018-11-13 15:45     ` Jarkko Sakkinen [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=20181113154547.GA4601@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=kgoldman@us.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=nayna@linux.ibm.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 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).