Skip to content

x86/early_tpm_extend: issue COMMAND_READY after successful read#164

Open
accek-itl wants to merge 1 commit intoTrenchBoot:linux-sl-master-11-30-25-v15from
accek-itl:pr/3ac2d740-command-ready-read
Open

x86/early_tpm_extend: issue COMMAND_READY after successful read#164
accek-itl wants to merge 1 commit intoTrenchBoot:linux-sl-master-11-30-25-v15from
accek-itl:pr/3ac2d740-command-ready-read

Conversation

@accek-itl
Copy link

Per "TCG PC Client Specific TPM Interface Specification (TIS), Fig. 3 (State Transition Diagram)" one needs to first issue COMMAND_READY after reading the response, to move from "Command Completion" to "Idle". And then before issuing the next command, another COMMAND_READY is needed to move to "Ready" state.

Some TPM chips do not require it, because specification allows to automatically move from "Idle" to "Ready" and that's why the code worked on some platforms.

Without the fix we get crash in MLE at [1] at second and subsequent call.

[1]

sl_txt_reset(SL_ERROR_TPM_EXTEND);

Per "TCG PC Client Specific TPM Interface Specification (TIS), Fig. 3
(State Transition Diagram)" one needs to first issue COMMAND_READY
after reading the response, to move from "Command Completion" to "Idle".
And then before issuing the next command, another COMMAND_READY
is needed to move to "Ready" state.

Some TPM chips do not require it, because specification allows to
automatically move from "Idle" to "Ready" and that's why the code worked
on some platforms.

Without the fix we get crash in MLE at [1] at second and subsequent call.

[1] https://github.com/TrenchBoot/linux/blob/040f882a9605f39552e70b090ab88716a3cebc66/arch/x86/boot/compressed/sl_main.c#L382

Signed-off-by: Szymon "accek" Acedański <accek@invisiblethingslab.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant