mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ima: select the SHA384 PCR bank for the boot aggregate
@ 2026-08-26 19:11 Singh, Jashandeep
  2026-08-26 21:20 ` Mimi Zohar
  0 siblings, 1 reply; 8+ messages in thread
From: Singh, Jashandeep @ 2026-08-26 19:11 UTC (permalink / raw)
  To: Mimi Zohar, Roberto Sassu, Dmitry Kasatkin
  Cc: Eric Snowberg, linux-integrity, linux-security-module,
	linux-kernel, Jashandeep Singh

From: Jashandeep Singh <jdsw@juniper.net>

ima_calc_boot_aggregate() selects a TPM PCR bank matching the
configured IMA hash algorithm, otherwise falling back to the SHA256
bank or the SHA1 bank.

A TPM 2.0 can be provisioned with only the SHA384 bank enabled, with no
SHA256 or SHA1 bank. None of the above then matched, selection failed
with

    ima: No suitable TPM algorithm for boot aggregate

and the boot aggregate digest was left as zeros, as for TPM bypass,
making remote attestation impossible.

Accept the SHA384 bank as a fallback. The configured IMA hash algorithm
is still matched first.

Signed-off-by: Jashandeep Singh <jdsw@juniper.net>
---
 security/integrity/ima/ima_crypto.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c
index 0d72b48249ee..c7a60b438955 100644
--- a/security/integrity/ima/ima_crypto.c
+++ b/security/integrity/ima/ima_crypto.c
@@ -491,7 +491,8 @@ int ima_calc_boot_aggregate(struct ima_digest_data *hash)
 			break;
 		}
 
-		if (crypto_id == HASH_ALGO_SHA256)
+		if (crypto_id == HASH_ALGO_SHA256 ||
+		    crypto_id == HASH_ALGO_SHA384)
 			bank_idx = i;
 
 		if (bank_idx == -1 && crypto_id == HASH_ALGO_SHA1)
-- 
2.34.1


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

end of thread, other threads:[~2026-08-27 20:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-26 19:11 [PATCH] ima: select the SHA384 PCR bank for the boot aggregate Singh, Jashandeep
2026-08-26 21:20 ` Mimi Zohar
     [not found]   ` <PH7PR84MB16549E7A6AC842D358493B0F96AE2@PH7PR84MB1654.NAMPRD84.PROD.OUTLOOK.COM>
2026-08-26 23:14     ` Mimi Zohar
2026-08-27 13:17       ` Roberto Sassu
2026-08-27 14:46         ` Singh, Jashandeep
2026-08-27 14:56           ` Roberto Sassu
2026-08-27 15:49             ` Mimi Zohar
2026-08-27 20:03               ` Singh, Jashandeep

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

all inboxes | Powered by JetHome®