Skip to content

tpm2_eventlog: Fix parsing on big-endian systems#3506

Merged
JuergenReppSIT merged 1 commit intotpm2-software:masterfrom
shoracek:s390x_eventlog_fix
Sep 8, 2025
Merged

tpm2_eventlog: Fix parsing on big-endian systems#3506
JuergenReppSIT merged 1 commit intotpm2-software:masterfrom
shoracek:s390x_eventlog_fix

Conversation

@shoracek
Copy link
Contributor

@shoracek shoracek commented Aug 8, 2025

When using tpm2_eventlog on big-endian systems, instead of properly parsing the file I get an error:

---
version: 2
events:
ERROR: insufficient size for SpecID event data
ERROR: failed to parse tpm2 eventlog
ERROR: Unable to run tpm2_eventlog

After the changes, the output is the same as on a little-endian system.

Tested by running tpm2_eventlog --eventlog-version=2 binary_bios_measurements on x86_64 machine and s390x machine and comparing the outputs.

I couldn't find s390x machine with TPM, so I used binary_bios_measurements file from x86_64 machine. I don't think that should be an issue though, as according to the TCG PC Client Platform Firmware Profile Specification standard the structures should be all in little endian, if I understand correctly.

@shoracek shoracek marked this pull request as ready for review August 18, 2025 14:08
Copy link
Member

@AndreasFuchsTPM AndreasFuchsTPM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct the trailing-spaces-empty-indet

break;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh... ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

Signed-off-by: Štěpán Horáček <shoracek@redhat.com>
@JuergenReppSIT JuergenReppSIT merged commit 7b29cac into tpm2-software:master Sep 8, 2025
22 of 23 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.

3 participants