Skip to content

Commit

Permalink
should panic when sec.memory_data_size < sec.raw_data_size
Browse files Browse the repository at this point in the history
Signed-off-by: OuyangHang33 <[email protected]>
  • Loading branch information
OuyangHang33 authored and jyao1 committed May 7, 2024
1 parent de5a923 commit 48aef42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions td-shim-tools/src/tee_info_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ impl TdInfoStruct {
panic!("Memory address must be 4K aligned!\n");
}

if sec.memory_data_size < sec.raw_data_size as u64 {
panic!("Memory data size must exceed or equal the raw data size!\n");
}

if sec.memory_data_size % PAGE_SIZE != 0 {
panic!("Memory data size must be 4K aligned!\n");
}
Expand Down

0 comments on commit 48aef42

Please sign in to comment.