hypervisor: use right size of host_data

Use right and exact size 32 bytes for host data field
for completing the isolated import. This way OOB
can be avoided during a function call.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam 2024-01-04 15:39:52 -08:00 committed by Bo Chen
parent 433d4ddc0c
commit cbcbf635ab
2 changed files with 3 additions and 3 deletions

View File

@ -1814,7 +1814,7 @@ impl vm::Vm for MshvVm {
fn complete_isolated_import(
&self,
snp_id_block: IGVM_VHS_SNP_ID_BLOCK,
host_data: &[u8],
host_data: [u8; 32],
id_block_enabled: u8,
) -> vm::Result<()> {
let mut auth_info = hv_snp_id_auth_info {
@ -1847,7 +1847,7 @@ impl vm::Vm for MshvVm {
policy: get_default_snp_guest_policy(),
},
id_auth_info: auth_info,
host_data: host_data[0..32].try_into().unwrap(),
host_data,
id_block_enabled,
author_key_enabled: 0,
},

View File

@ -385,7 +385,7 @@ pub trait Vm: Send + Sync + Any {
fn complete_isolated_import(
&self,
_snp_id_block: IGVM_VHS_SNP_ID_BLOCK,
_host_data: &[u8],
_host_data: [u8; 32],
_id_block_enabled: u8,
) -> Result<()> {
unimplemented!()