Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tee-info-hash-tool: update the metadata check when type is TD_INFO #752

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion td-shim-tools/src/tee_info_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ impl TdInfoStruct {
panic!("Memory address must be 4K aligned!\n");
}

if sec.memory_data_size < sec.raw_data_size as u64 {
// MemoryAddress and MemoryDataSize shall be zero when the section type is TD_INFO
if (sec.r#type != TDX_METADATA_SECTION_TYPE_TD_INFO)
&& (sec.memory_address != 0 || sec.memory_data_size != 0)
&& sec.memory_data_size < sec.raw_data_size as u64
{
panic!("Memory data size must exceed or equal the raw data size!\n");
}

Expand Down
Loading