mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
hypervisor: mshv: Fix panic when rejecting extended guest report
swei2_rw_gpa_arg.data is an array of size 16 and value.to_le_bytes() is only 8 bytes. Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> Signed-off-by: Tom Dohrmann <erbse.13@gmx.de>
This commit is contained in:
parent
ce49a6f4b8
commit
ca88d4449e
@ -1012,7 +1012,8 @@ impl cpu::Vcpu for MshvVcpu {
|
||||
byte_count: std::mem::size_of::<u64>() as u32,
|
||||
..Default::default()
|
||||
};
|
||||
swei2_rw_gpa_arg.data.copy_from_slice(&value.to_le_bytes());
|
||||
swei2_rw_gpa_arg.data[0..8]
|
||||
.copy_from_slice(&value.to_le_bytes());
|
||||
self.fd
|
||||
.gpa_write(&mut swei2_rw_gpa_arg)
|
||||
.map_err(|e| cpu::HypervisorCpuError::GpaWrite(e.into()))?;
|
||||
|
Loading…
Reference in New Issue
Block a user