lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 6 May 2022 14:31:48 +0200
From:   Stefan Mahnke-Hartmann <stefan.mahnke-hartmann@...ineon.com>
To:     <jarkko@...nel.org>, <linux-integrity@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
CC:     <Marten.Lindahl@...s.com>, <martenli@...s.com>, <jgg@...pe.ca>,
        <jsnitsel@...hat.com>, <nayna@...ux.vnet.ibm.com>,
        <johannes.holland@...ineon.com>, <peterhuewe@....de>,
        Stefan Mahnke-Hartmann <stefan.mahnke-hartmann@...ineon.com>
Subject: [PATCH 2/2] tpm: Add Field Upgrade mode support for Infineon TPM2 modules

TPM2_GetCapability with a capability that has the property type value
of TPM_PT_TOTAL_COMMANDS returns a zero length list, when an Infineon
TPM2 is in Field Upgrade mode.
Since an Infineon TPM2.0 in Field Upgrade mode returns RC_SUCCESS on
TPM2_Startup, the Field Upgrade mode has to be detected by
TPM2_GetCapability.

Signed-off-by: Stefan Mahnke-Hartmann <stefan.mahnke-hartmann@...ineon.com>
---
 drivers/char/tpm/tpm2-cmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index e62a644ce26b..659130e2936e 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -746,6 +746,12 @@ int tpm2_auto_startup(struct tpm_chip *chip)
 	}
 
 	rc = tpm2_get_cc_attrs_tbl(chip);
+	/*
+	 * Infineon TPM in Field Upgrade mode will return no data for the number
+	 * of supported commands.
+	 */
+	if (rc == -ENODATA)
+		rc = TPM2_RC_UPGRADE;
 
 out:
 	if (rc == TPM2_RC_UPGRADE) {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ