Skip to content

Commit

Permalink
add memory address/size check for TD_INFO.
Browse files Browse the repository at this point in the history
fix #629

Signed-off-by: Yang, Longlong <[email protected]>
  • Loading branch information
longlongyang authored and jyao1 committed Dec 20, 2023
1 parent a4a2488 commit bb9c02e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions td-shim/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@ pub fn validate_sections(sections: &[TdxMetadataSection]) -> Result<(), TdxMetad
td_info_start = section.data_offset;
td_info_end = td_info_start + section.raw_data_size;
}

// MemoryAddress and MemoryDataSize shall be zero.
if section.memory_address != 0 || section.memory_data_size != 0 {
return Err(TdxMetadataError::InvalidSection);
}
}

_ => {
Expand Down

0 comments on commit bb9c02e

Please sign in to comment.