Re: [RFC PATCH 2/3] tpm/tpm_ftpm_tee: use send_recv() op

2025-03-13 Thread Jens Wiklander
On Thu, Mar 13, 2025 at 10:13 AM Sumit Garg wrote: > > + Jens > > Hi Stefano, > > On Tue, Mar 11, 2025 at 11:01:29AM +0100, Stefano Garzarella wrote: > > This driver does not support interrupts, and receiving the response is > > synchronous with sending the command. > > > > It used an internal buf

[RFC PATCH v1 0/7] ima: get rid of hard dependency on SHA-1

2025-03-13 Thread Nicolai Stange
Hi all, if no SHA-1 implementation was available to the kernel, IMA init would currently fail, rendering the whole subsystem unusable. This patch series is an attempt to make SHA-1 availability non-mandatory for IMA. The main motivation is that NIST announced to sunset SHA-1 by 2030 ([1]), whereb

[RFC PATCH v1 1/7] ima: don't expose runtime_measurements for unsupported hashes

2025-03-13 Thread Nicolai Stange
IMA creates one runtime_measurements_ sysfs file for every TPM bank + for SHA1 if not covered by any such. These differ only in that the template hash value for each record is of the file's associated algorithm each. The kernel does not necessarily support each hash algorithm associated with some

[RFC PATCH v1 2/7] ima: always create runtime_measurements sysfs file for ima_hash

2025-03-13 Thread Nicolai Stange
runtime_measurements_ sysfs files are getting created for each PCR bank + for SHA-1. Now that runtime_measurements_ sysfs file creation is being skipped for unsupported hash algorithms, it will become possible that no such file would be provided at all once SHA-1 is made optional in a later patch.

[RFC PATCH v1 3/7] ima: move INVALID_PCR() to ima.h

2025-03-13 Thread Nicolai Stange
Make the INVALID_PCR() #define available to other compilation units by moving it from ima_policy.c to ima.h and renaming it to IMA_INVALID_PCR() in the course. Signed-off-by: Nicolai Stange --- security/integrity/ima/ima.h| 4 security/integrity/ima/ima_policy.c | 5 + 2 files c

[RFC PATCH v1 5/7] tpm: enable bank selection for PCR extend

2025-03-13 Thread Nicolai Stange
The existing tpm_pcr_extend() extends all of a PCR's allocated banks with the corresponding digest from the provided digests[] argument. An upcoming code change to IMA will introduce the need to skip over those banks it does not have a hash algorithm implementation available for. Introduce tpm_pc

[RFC PATCH v1 4/7] ima: track the set of PCRs ever extended

2025-03-13 Thread Nicolai Stange
A subsequent patch will make IMA to invalidate PCR banks associated with unsupported hash algorithms once at a PCR's first use. To prepare for that, make it track the set of PCRs ever extended. Maintain the set of touched PCRs in an unsigned long bitmask, 'ima_extended_pcrs_mask'. Amend the IMA_I

[RFC PATCH v1 6/7] ima: invalidate unsupported PCR banks once at first use

2025-03-13 Thread Nicolai Stange
Normally IMA would extend a template hash of each bank's associated algorithm into a PCR. However, if a bank's hash algorithm is unavailable to the kernel at IMA init time, it would fallback to extending padded SHA1 hashes instead. That is, if e.g. SHA-256 was missing at IMA init, it would extend

[RFC PATCH v1 7/7] ima: make SHA1 non-mandatory

2025-03-13 Thread Nicolai Stange
For CONFIG_IMA_COMPAT_FALLBACK_TPM_EXTEND=n, SHA-1 is not a hard requirement anymore. Make ima_init_crypto() continue on SHA-1 instantiation errors. Note that the configure ima_hash must still be available. If that happened to be set to SHA-1 and SHA-1 was missing, then IMA would still fail to ini

Re: [RFC PATCH 2/3] tpm/tpm_ftpm_tee: use send_recv() op

2025-03-13 Thread Sumit Garg
+ Jens Hi Stefano, On Tue, Mar 11, 2025 at 11:01:29AM +0100, Stefano Garzarella wrote: > This driver does not support interrupts, and receiving the response is > synchronous with sending the command. > > It used an internal buffer to cache the response when .send() is called, > and then return i

[PATCH] tpm/tpm_ftpm_tee: fix struct ftpm_tee_private documentation

2025-03-13 Thread Stefano Garzarella
The `state` member in `struct ftpm_tee_private` is in the documentation, but it has never been in the implementation since the commit 09e574831b27 ("tpm/tpm_ftpm_tee: A driver for firmware TPM running inside TEE") that introduced it. Remove it to have a match between documentation and implementati

[PATCH v8 5/5] Documentation: tpm: add documentation for the CRB FF-A interface

2025-03-13 Thread Stuart Yoder
Add documentation providing details of how the CRB driver interacts with FF-A. Reviewed-by: Jarkko Sakkinen Signed-off-by: Stuart Yoder --- Documentation/security/tpm/index.rst | 1 + Documentation/security/tpm/tpm_ffa_crb.rst | 65 ++ 2 files changed, 66 insertions(+