system76 / firmware-open

System76 Open Firmware
Other
949 stars 86 forks source link

SLB 9672 fails to start from resume #427

Closed crawfxrd closed 1 year ago

crawfxrd commented 1 year ago

The new Infineon TPM chip sometimes fail init on resume from S3. (So presumably it can also happen on boot.)

Steps to reproduce

sudo fwts s3 --s3-multiple 50 --s3-min-delay 12 --s3-max-delay 15

Expected behavior

Actual behavior

Additional info

[INFO ]  Found TPM unknown by Infineon
[INFO ]  TPM: Handle S3 resume.
[INFO ]  tlcl_send_startup: Startup return code is 1c4
[ERROR]  TPM: Resume failed (0x1f).
crawfxrd commented 1 year ago

None of the following resolve the issue:

Additionally, all commands from tpm2-tools fail when in this state, including tpm2_getcap.

The error we get back is TPM_RC_VALUE, which should mean that TPM state is not being saved or is being lost.

If a TPM receives Startup(STATE) and that was not preceded by Shutdown(STATE), the TPM shall return TPM_RC_VALUE.

If, during TPM Restart or TPM Resume, the TPM fails to restore the state saved at the last Shutdown(STATE), the TPM shall enter Failure Mode and return TPM_RC_FAILURE.

If the startupType is TPM_SU_STATE and the TPM requires TPM_SU_CLEAR, then the TPM shall return TPM_RC_VALUE.

crawfxrd commented 1 year ago

Also does not fix the issue:

crawfxrd commented 1 year ago

https://trustedcomputinggroup.org/wp-content/uploads/TCG_TPM2_r1p59_Part1_Architecture_pub.pdf

If the TPM receives Startup(STATE) that was not preceded by Shutdown(STATE), then there is no state to restore and the TPM will return TPM_RC_VALUE. The CRTM is expected to take corrective action to prevent malicious software from manipulating the PCR values such that they would misrepresent the state of the platform. The CRTM would abort the Startup(State) and restart with Startup(CLEAR).

NOTE 2: The startup behavior defined by this specification is different than TPM 1.2 with respect to Startup(STATE). A TPM 1.2 device will enter Failure Mode if no state is available when the TPM receives Startup(STATE). This is not the case in this specification. It is up to the CRTM to take corrective action if it the TPM returns TPM_RC_VALUE in response to Startup(STATE).

https://trustedcomputinggroup.org/wp-content/uploads/TCG_TPM2_r1p59_Part3_Commands_code_pub.pdf

If a TPM receives Startup(STATE) and that was not preceded by Shutdown(STATE), the TPM shall return TPM_RC_VALUE.

If, during TPM Restart or TPM Resume, the TPM fails to restore the state saved at the last Shutdown(STATE), the TPM shall enter Failure Mode and return TPM_RC_FAILURE.