Skip to content

Backport a few patches to stable-0.9#579

Merged
stefanberger merged 2 commits into
stable-0.9from
stable-0.9.next
May 8, 2026
Merged

Backport a few patches to stable-0.9#579
stefanberger merged 2 commits into
stable-0.9from
stable-0.9.next

Conversation

@stefanberger

Copy link
Copy Markdown
Owner

No description provided.

Limit the variable indicating to the caller how many bytes were returned
in a TPM response to the size returned from TPM2_GetBufferSize(). This
then reflects the buffer size that was negotiated with the
TPMLIB_SetBufferSize() call and for which the recipient of the buffer
should have enough space for.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
The minimum buffer size was set to MAX_CONTEXT_SIZE + 128, which is fine
if the assumption that the actual biggest command or response buffer is
created by TPM2_ContextLoad/Save commands holds. If the assumption was
not holding, then the choice of the minimum buffer size would truncate
response sizes. Adjust this size to the sizeof(TPMS_CONTEXT), which is
80 bytes bigger than MAX_CONTEXT_SIZE but still related to
TPM2_ContextLoad/Save commands. Still add a generous additional 128 bytes
to it.

Add a comment about the maximum size and the sizes used by TIS and CRB.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
@stefanberger stefanberger changed the title Backport a few patches Backport a few patches to stable-0.9 Apr 30, 2026
@stefanberger stefanberger merged commit ca95df1 into stable-0.9 May 8, 2026
4 checks passed
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