Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH v6 0/2] Move TPM-specific fields out of trusted_key_options
@ 2026-09-02 10:31 Srish Srinivasan
  2026-09-02 10:31 ` [PATCH 1/2] keys/trusted_keys: return immediately after TPM unseal failure Srish Srinivasan
  2026-09-02 10:31 ` [PATCH v6 2/2] keys/trusted_keys: move TPM-specific fields into struct trusted_key_tpm Srish Srinivasan
  0 siblings, 2 replies; 4+ messages in thread
From: Srish Srinivasan @ 2026-09-02 10:31 UTC (permalink / raw)
  To: linux-integrity, keyrings
  Cc: James.Bottomley, jarkko, zohar, linux-kernel,
	linux-security-module, nayna, rnsastry, ssrish

struct trusted_key_options contains fields that are specific to the TPM
trusted source, resulting in the accumulation backend-specific fields in
the generic options structure.

Move the TPM-specific fields into a new struct trusted_key_tpm and store a
pointer to it in the private member of struct trusted_key_options.

As a preparatory change, return immediately after a TPM unseal failure to
prevent pcrlock() from overwriting the unseal error.

Changelog:

 v6:
 - Add a preparatory fix to return immediately after a TPM unseal failure
 - Replace explicit cleanup with __free(kfree_sensitive) in the TPM seal
   and unseal paths, as suggested by Jarkko

 v5:
  - Rename struct trusted_tpm_options to struct trusted_key_tpm, as
    suggestedby Jarkko.

 v4:
  - Rebased onto mainline after tpm-buf memory-safe allocation changes were
    merged
  - Resolved the resulting merge conflicts

 v3:
  - Exclude the preparatory clean up patch as the problem has been
    addressed in commit
    9ec4175a30eb ("KEYS: trusted: Debugging as a feature")

 v2:
  - Exclude the bug-fix patch as it has already been applied to 6.19-rc7
  - Rename instances of trusted_tpm_options from tpm_opts to private
  - Use pr_debug and KERN_DEBUG for logging debug messages (preparatory
    clean up patch)
  - Address other minor comments from Jarkko

Srish Srinivasan (2):
  keys/trusted_keys: return immediately after TPM unseal failure
  keys/trusted_keys: move TPM-specific fields into struct
    trusted_key_tpm

 include/keys/trusted-type.h               |  11 --
 include/keys/trusted_tpm.h                |  14 +++
 security/keys/trusted-keys/trusted_tpm1.c | 125 ++++++++++++----------
 security/keys/trusted-keys/trusted_tpm2.c |  50 +++++----
 4 files changed, 113 insertions(+), 87 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-02 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-02 10:31 [PATCH v6 0/2] Move TPM-specific fields out of trusted_key_options Srish Srinivasan
2026-09-02 10:31 ` [PATCH 1/2] keys/trusted_keys: return immediately after TPM unseal failure Srish Srinivasan
2026-09-02 22:24   ` Srish Srinivasan
2026-09-02 10:31 ` [PATCH v6 2/2] keys/trusted_keys: move TPM-specific fields into struct trusted_key_tpm Srish Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox