tpm: Limit TCG_TPM2_HMAC to known good drivers
Subsystems (5)
Jarkko Sakkinen
maintainerPATCH 1/1 tpm: Limit TCG_TPM2_HMAC to known good drivers
IBM vTPM driver lacks a call to tpm2_sessions_init() and reports:
[ 2.987131] tpm tpm0: tpm2_load_context: failed with a TPM error 0x01C4 [ 2.987140] ima: Error Communicating to TPM chip, result: -14
HMAC encryption code also has a risk of null derefence, given that when uninitialized, chip->auth is a null pointer.
Limit TCG_TPM2_HMAC to known good drivers until these issues have been properly fixed.
--- drivers/char/tpm/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/char/tpm/Kconfig +1 -0
@@ -30,6 +30,7 @@ if TCG_TPM config TCG_TPM2_HMAC bool "Use HMAC and encrypted transactions on the TPM bus" default X86_64 + depends on TCG_CRB || TCG_TIS_CORE select CRYPTO_ECDH select CRYPTO_LIB_AESCFB select CRYPTO_LIB_SHA256
Signature · 1 line
2.45.2
Jarkko Sakkinen
maintainerdrivers/char/tpm/Kconfig if TCG_TPM · line 33
Quoted 1 line · Jarkko Sakkinen
drivers/char/tpm/Kconfig +1
-0+ depends on TCG_CRB || TCG_TIS_CORE
Needs to be "depends on !TCG_IBMVTPM":
https://lore.kernel.org/linux-integrity/[email protected]/
BR, Jarkko
Jarkko Sakkinen
maintainerQuoted 6 lines · Jarkko Sakkinen
drivers/char/tpm/Kconfig if TCG_TPM · line 33
Quoted 1 line · Jarkko Sakkinen
drivers/char/tpm/Kconfig +1
-0+ depends on TCG_CRB || TCG_TIS_CORENeeds to be "depends on !TCG_IBMVTPM":
This ended up such a mess to fix with any fast path so I made a proper fix for the core issue in the hmac authentication patch set:
https://lore.kernel.org/linux-integrity/[email protected]/
The problem is that tpm_crb and tpm_tis_core are the *only* drivers, which call tpm_chip_bootstrap() so it is better not to take any possible risks with this. I'm still aiming to get these fixes into 6.10.
BR, Jarkko