fix(tdeventlog): fix SpecID header detection and exclude invalid RTMRs#418
Open
hyperfinitism wants to merge 1 commit intocanonical:mainfrom
Open
fix(tdeventlog): fix SpecID header detection and exclude invalid RTMRs#418hyperfinitism wants to merge 1 commit intocanonical:mainfrom
hyperfinitism wants to merge 1 commit intocanonical:mainfrom
Conversation
Signed-off-by: Takuma IMAMURA <209989118+hyperfinitism@users.noreply.github.com>
8741dc4 to
43b4ba3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes parsing/replay issues observed on some cloud platforms.
Issue summary
On some environments (e.g. Google Compute Engine C3 on Ubuntu 24.04+), the CCEL/TCG event log can contain multiple
EV_NO_ACTIONentries, while only one of them is the Spec ID event.The current parser assumes the first
EV_NO_ACTIONentry is always the Spec ID event, which can lead to an incorrectself._specid_headerassignment and subsequent parse failures when processing following entries.Additionally, some environments (including GCE C3) emit event log entries with an RTMR index of
-1(i.e. non-extendable / out of the valid RTMR range). Attempting to replay such entries causes RTMR replay to fail.Changes
b"Spec ID Event03\x00") in the event data-1)with) when readinginitrd.imgto silencepylintwarningTest
Test Environments
I have tested on the following environments (both Ubuntu 24.04 LTS and 25.04):
Setup
Reproduce the issue
Reproduce the reported issue in the current main branch:
Test this patch
Verify that this PR resolves the issue:
The following are the results obtained when executed in my environments (partially omitted). It can be confirmed that the RTMR values are correctly reproduced.