Skip to content

Prepare TPM driver for Trenchboot

Jarkko Sakkinen keyrings linux-integrity linux-security-module lkml stable 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest8 patches 2 repliesIn review
  2. v811 patches 0 repliesSuperseded
  3. v711 patches 15 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v610 patches4 repliesSuperseded
v59 patches0 repliesSuperseded
v49 patches1 replySuperseded
v310 patches20 repliesSuperseded

Changes in v9 from the cover letter

- Dropped patches that went into 6.19 pull request (and that is main reason for sending update so quickly).
- I went through the commit message and polished a bit most of them
- Simplified the patch fixing memory leak in tpm2_load_cmd. v8:
- Fixed reported issues.
- Did some focused testing on TPM 1.2 using swtpm to make sure that it is working correctly.

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8tpm2-sessions: Remove 'attributes' parameter from tpm_buf_append_authdrivers/char/tpm/tpm2-cmd.c drivers/char/tpm/tpm2-sessions.c include/linux/tpm.h+4 -50 replies
2/8tpm2-sessions: Open code tpm_buf_append_hmac_session()drivers/char/tpm/tpm2-cmd.c include/linux/tpm.h security/keys/trusted-keys/trusted_tpm2.c+21 -280 replies
3/8KEYS: trusted: Replace a redundant instance of tpm2_hash_mapdrivers/char/tpm/tpm2-cmd.c include/linux/tpm.h security/keys/trusted-keys/trusted_tpm2.c+18 -202 replies
4/8KEYS: trusted: Fix a memory leak in tpm2_load_cmdsecurity/keys/trusted-keys/trusted_tpm2.c+4 -20 replies
5/8KEYS: trusted: Open code tpm2_buf_append()security/keys/trusted-keys/trusted_tpm2.c+9 -420 replies
6/8tpm-buf: Merge TPM_BUF_BOUNDARY_ERROR and TPM_BUF_OVERFLOWdrivers/char/tpm/tpm-buf.c include/linux/tpm.h security/keys/trusted-keys/trusted_tpm2.c+14 -140 replies
7/8tpm-buf: Remove chip parameter from tpm_buf_append_handledrivers/char/tpm/tpm-buf.c drivers/char/tpm/tpm2-cmd.c drivers/char/tpm/tpm2-sessions.c +1 more+5 -60 replies
8/8tpm-buf: Enable managed and stack allocations.drivers/char/tpm/tpm-buf.c drivers/char/tpm/tpm-sysfs.c drivers/char/tpm/tpm.h +8 more+488 -5440 replies

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchJonathan McDowellStefan Berger
1/8R-b
2/8R-b
3/8R-b
4/8
5/8R-b
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v9 thread

Cover letter [PATCH v9 0/8] Prepare TPM driver for Trenchboot

Overview
========

Start preparing TPM driver for Trenchboot by decoupling tpm_buf from driver and memory allocation.

Backlog (of stuff that will end up to a follow-up patch sets):

1. Static flat duration table for TPM 1.2. Such feature already landed in v6.17 for TPM 2.0. We probably can figure out some sane roof values for the legacy standard, right? This allows to share more code "via data".
2. Not a blocker for sending subsequent versions of Trenchboot patch set but we could look at slicing tpm_tis code at some point of future. It could be even that redundant parts could be "merged" after the feature lands but this is neither a promise (depends on how things look overall).

This patch set does not do a lot heavy-lifting but is beefed enough that it is better not fatten it up too much anymore. Sane buffering is a great starting point.

v9:
- Dropped patches that went into 6.19 pull request (and that is main reason for sending update so quickly).
- I went through the commit message and polished a bit most of them
- Simplified the patch fixing memory leak in tpm2_load_cmd. v8:
- Fixed reported issues.
- Did some focused testing on TPM 1.2 using swtpm to make sure that it is working correctly.
v7:
- Fixed reported issues.
v6:
- Fixed a memory leak that I found trom trusted keys.
v5:
- Order sobs correctly.
- Fixed a minor glitch in 9/9.
v4:
- PCR patch has been removed because it does not fly without Trenchboot context.
v3:
- I think 6.19 is a better goal for this and thus expanded the series to be a generic Trenchboot enablers series. This version also consolidates my two separate ongoing series.
v2:
- While including fixes from v1, this patch set has a refocus in order to do minimal changes to make code base more compatible Trenchboot.

Jarkko Sakkinen (8):
tpm2-sessions: Remove 'attributes' parameter from tpm_buf_append_auth
tpm2-sessions: Open code tpm_buf_append_hmac_session()
KEYS: trusted: Replace a redundant instance of tpm2_hash_map
KEYS: trusted: Fix a memory leak in tpm2_load_cmd
KEYS: trusted: Open code tpm2_buf_append()
tpm-buf: Merge TPM_BUF_BOUNDARY_ERROR and TPM_BUF_OVERFLOW
tpm-buf: Remove chip parameter from tpm_buf_append_handle
tpm-buf: Enable managed and stack allocations.

 drivers/char/tpm/tpm-buf.c                | 143 ++++++----
 drivers/char/tpm/tpm-sysfs.c              |  21 +-
 drivers/char/tpm/tpm.h                    |   1 -
 drivers/char/tpm/tpm1-cmd.c               | 162 +++++------
 drivers/char/tpm/tpm2-cmd.c               | 319 +++++++++++-----------
 drivers/char/tpm/tpm2-sessions.c          | 129 +++++----
 drivers/char/tpm/tpm2-space.c             |  44 ++-
 drivers/char/tpm/tpm_vtpm_proxy.c         |  30 +-
 include/linux/tpm.h                       |  56 ++--
 security/keys/trusted-keys/trusted_tpm1.c |  36 +--
 security/keys/trusted-keys/trusted_tpm2.c | 245 +++++++----------
 11 files changed, 544 insertions(+), 642 deletions(-)
Signature · 1 line
2.52.0