linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nayna Jain <nayna@linux.vnet.ibm.com>
To: tpmdd-devel@lists.sourceforge.net,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: peterhuewe@gmx.de, tpmdd@selhorst.net,
	jarkko.sakkinen@linux.intel.com, jgunthorpe@obsidianresearch.com,
	Nayna Jain <nayna@linux.vnet.ibm.com>
Subject: [PATCH v2 0/2] tpm: enhance TPM 2.0 extend function to support multiple PCR banks
Date: Fri, 30 Dec 2016 14:02:28 -0500	[thread overview]
Message-ID: <1483124550-9529-1-git-send-email-nayna@linux.vnet.ibm.com> (raw)

IMA extends its hash measurements in the TPM PCRs, based on policy.
The existing in-kernel TPM extend function extends only the SHA1
PCR bank. TPM 2.0 defines multiple PCR banks, to support different
hash algorithms. The TCG TPM 2.0 Specification[1] recommends
extending all active PCR banks to prevent malicious users from
setting unused PCR banks with fake measurements and quoting them.
This patch set adds support for extending all active PCR banks,
as recommended.

The first patch implements the TPM 2.0 capability to retrieve
the list of active PCR banks.

The second patch modifies the tpm_pcr_extend() and tpm2_pcr_extend()
interface to support extending multiple PCR banks. The existing
tpm_pcr_extend() interface expects only a SHA1 digest. Hence, to
extend all active PCR banks with differing digest sizes for TPM 2.0,
the SHA1 digest is padded with 0's as needed.

This approach is taken to maintain backwards compatibility for IMA
in order to continue working with both TPM 1.2 and TPM 2.0 without
any changes and still comply with TCG TPM 2.0 Specification[1].

[1] TPM 2.0 Specification referred here is "TCG PC Client Specific
Platform Firmware Profile for TPM 2.0"

Changelog v2:

- Patch "tpm: implement TPM 2.0 capability to get active PCR banks"
  - defined structs definition in tpm2-cmd.c.
  - no_of_active_banks field is removed. Instead, constant
  TPM2_MAX_PCR_BANKS is defined.
  - renamed tpm2_get_active_pcr_banks() to tpm2_get_pcr_allocation()
  - removed generic function tpm2_get_capability().

- Patch "tpm: enchance TPM 2.0 PCR extend to support multiple banks"
 - Removed tpm2.h, and defined structs common for extend and event log
  in tpm_eventlog.h
 - uses tpm_buf in tpm2_pcr_extend().

Nayna Jain (2):
  tpm: implement TPM 2.0 capability to get active PCR banks
  tpm: enhance TPM 2.0 PCR extend to support multiple banks

 drivers/char/tpm/tpm-interface.c |  16 ++++-
 drivers/char/tpm/tpm.h           |   8 ++-
 drivers/char/tpm/tpm2-cmd.c      | 146 +++++++++++++++++++++++++++++++--------
 drivers/char/tpm/tpm_eventlog.h  |  15 ++++
 4 files changed, 153 insertions(+), 32 deletions(-)

-- 
2.5.0

             reply	other threads:[~2016-12-30 19:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-30 19:02 Nayna Jain [this message]
2016-12-30 19:02 ` [PATCH v2 1/2] tpm: implement TPM 2.0 capability to get active PCR banks Nayna Jain
2017-01-03 18:52   ` Jarkko Sakkinen
2016-12-30 19:02 ` [PATCH v2 2/2] tpm: enhance TPM 2.0 PCR extend to support multiple banks Nayna Jain
2016-12-30 20:53   ` kbuild test robot
2016-12-30 21:17   ` kbuild test robot
2017-01-03 18:54   ` Jarkko Sakkinen
2017-01-02 22:15 ` [PATCH v2 0/2] tpm: enhance TPM 2.0 extend function to support multiple PCR banks Jarkko Sakkinen
2017-01-03 12:27   ` [tpmdd-devel] " Mimi Zohar
2017-01-03 13:55     ` Jarkko Sakkinen
2017-01-03 13:29   ` Jarkko Sakkinen

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=1483124550-9529-1-git-send-email-nayna@linux.vnet.ibm.com \
    --to=nayna@linux.vnet.ibm.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    /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).