Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1635125

[PATCH v2 0/3] tpm_pcr_extend() code split

From Roberto Sassu <roberto.sassu@huawei.com>
Newsgroups linux.kernel
Subject [PATCH v2 0/3] tpm_pcr_extend() code split
Date 2017-05-03 18:30 +0200
Message-ID <tD5k5-7NI-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This patch set moves TPM 1.2 specific code to a new function called
tpm1_pcr_extend(). The purpose of splitting is to isolate TPM 2.0 code,
so that it can be more easily modified to handle multiple digests.

With TPM 2.0, a Platform Configuration Register (PCR) could have multiple
values, stored in locations called banks. Each bank stores the values
of PCRs extended with the same hash algorithm.

Currently, the TPM kernel driver does not take advantage of stronger
algorithms because PCRs are always extended with a SHA1 digest, padded
with zeros to match the length of the input for the hash algorithm
being used. Shortly after these patches, a new patch set will be provided
to allow callers of tpm_pcr_extend() to pass a digest for each algorithm
supported by the TPM.

In this patch set, TPM 1.2 specific code will prepare the command buffer
with tpm_buf_init() which, in respect to the previous method, offers
protection against buffer overflow. Moreover, CPU native to big-endian
conversion has been removed from tags and ordinals definitions, as it is
already done by tpm_buf_init().

Changelog:

v2
- restored TPM_TAG_RQU_COMMAND definition in drivers/char/tpm/tpm.h
- removed endianness conversion in TPM_TAG_RQU_COMMAND definition
- removed '#include <linux/tpm_command.h>' in tpm-interface.c
  and tpm-sysfs.c
- restored TPM_ORD_ definitions in tpm-interface.c and tpm-sysfs.c

Roberto Sassu (3):
  tpm: move endianness conversion of TPM_TAG_RQU_COMMAND to
    tpm_input_header
  tpm: move endianness conversion of ordinals to tpm_input_header
  tpm: move TPM 1.2 code of tpm_pcr_extend() to tpm1_pcr_extend()

 drivers/char/tpm/tpm-interface.c | 79 ++++++++++++++++++++++------------------
 drivers/char/tpm/tpm-sysfs.c     |  6 +--
 drivers/char/tpm/tpm.h           |  2 +-
 3 files changed, 47 insertions(+), 40 deletions(-)

-- 
2.9.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] tpm_pcr_extend() code split Roberto Sassu <roberto.sassu@huawei.com> - 2017-05-03 18:30 +0200
  [PATCH v2 2/3] tpm: move endianness conversion of ordinals to tpm_input_header Roberto Sassu <roberto.sassu@huawei.com> - 2017-05-03 18:30 +0200
    Re: [PATCH v2 2/3] tpm: move endianness conversion of ordinals to  tpm_input_header Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-04 19:40 +0200
  [PATCH v2 3/3] tpm: move TPM 1.2 code of tpm_pcr_extend() to tpm1_pcr_extend() Roberto Sassu <roberto.sassu@huawei.com> - 2017-05-03 18:30 +0200
    Re: [PATCH v2 3/3] tpm: move TPM 1.2 code of tpm_pcr_extend() to  tpm1_pcr_extend() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-04 12:10 +0200
  Re: [PATCH v2 0/3] tpm_pcr_extend() code split Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-04 11:30 +0200
    Re: [PATCH v2 0/3] tpm_pcr_extend() code split Roberto Sassu <roberto.sassu@huawei.com> - 2017-05-04 14:40 +0200
    Re: [PATCH v2 0/3] tpm_pcr_extend() code split Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-04 19:40 +0200
  [PATCH v2, RESEND 3/3] tpm: move TPM 1.2 code of tpm_pcr_extend() to tpm1_pcr_extend() Roberto Sassu <roberto.sassu@huawei.com> - 2017-05-04 13:20 +0200
    Re: [PATCH v2, RESEND 3/3] tpm: move TPM 1.2 code of  tpm_pcr_extend() to tpm1_pcr_extend() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-05 13:00 +0200

csiph-web