[PATCH v3 0/5] Unsorted tpm2-sessions improvements
From: Jarkko Sakkinen
Date: Sun Nov 15 2026 - 19:51:19 EST
Collected patches that still make sense from [1] and tweaked where needed.
[1] https://lore.kernel.org/linux-integrity/20260125192526.782202-1-jarkko@xxxxxxxxxx/#t
CHANGES
=======
v3:
- Add "tpm-buf: Make tpm_buf_read*() fallible".
v2:
- Based on Sashiko feedback I changed "offset += tpm_buf_read_u16()" into
"rc = tpm_buf_read_u16(...)" and "offset += rc". I'm convinced that this
was necessary but since it does not have a cost, at least this should
mute Sashiko.
VERSIONS
========
v1: https://lore.kernel.org/linux-integrity/20261115224722.1450498-1-jarkko@xxxxxxxxxx/
Cc: keyrings@xxxxxxxxxxxxxxx
Cc: linux-integrity@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-security-module@xxxxxxxxxxxxxxx
Cc: Alec Brown <alec.r.brown@xxxxxxxxxx>
Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
Cc: David Howells <dhowells@xxxxxxxxxx>
Cc: Eric Biggers <ebiggers@xxxxxxxxxx>
Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
Cc: James Morris <jmorris@xxxxxxxxx>
Cc: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
Cc: Jason Gunthorpe <jgg@xxxxxxxx>
Cc: Jonathan McDowell <noodles@xxxxxxxx>
Cc: Matthew Garrett <mjg59@xxxxxxxxxxxxx>
Cc: Mimi Zohar <zohar@xxxxxxxxxxxxx>
Cc: Paul Moore <paul@xxxxxxxxxxxxxx>
Cc: Peter Huewe <peterhuewe@xxxxxx>
Cc: Roberto Sassu <roberto.sassu@xxxxxxxxxx>
Cc: Ross Philipson <ross.philipson@xxxxxxxxx>
Cc: "Serge E. Hallyn" <serge@xxxxxxxxxx>
Jarkko Sakkinen (5):
tpm2-sessions: Drop TPM2_NAME_SIZE
KEYS: trusted: Open code tpm2_buf_append_auth()
KEYS: trusted: Remove dead branch from tpm2_unseal_cmd
tpm2-sessions: Re-orchestrate tpm2_read_public() use
tpm-buf: Make tpm_buf_read*() fallible
drivers/char/tpm/tpm-buf.c | 56 ++--
drivers/char/tpm/tpm-sysfs.c | 2 +-
drivers/char/tpm/tpm2-cmd.c | 9 +-
drivers/char/tpm/tpm2-sessions.c | 306 +++++++++++++---------
include/linux/tpm.h | 18 +-
include/linux/tpm_buf.h | 6 +-
security/keys/trusted-keys/trusted_tpm2.c | 93 +++----
7 files changed, 270 insertions(+), 220 deletions(-)
--
2.47.3