-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
microsoft.cloud-hypervisor: fix panic on ExtendedGuestReport
Signed-off-by: Paul Meyer <[email protected]>
- Loading branch information
1 parent
ac330d8
commit 093955c
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
.../microsoft/cloud-hypervisor/0001-snp-fix-panic-when-rejecting-extended-guest-report.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From e7980fa1acc9972073d394de86a48cee5410cd97 Mon Sep 17 00:00:00 2001 | ||
From: Tom Dohrmann <[email protected]> | ||
Date: Wed, 14 Aug 2024 16:02:39 +0200 | ||
Subject: [PATCH] snp: 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. | ||
--- | ||
hypervisor/src/mshv/mod.rs | 3 ++- | ||
1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs | ||
index f60d8ceb..b8fccf31 100644 | ||
--- a/hypervisor/src/mshv/mod.rs | ||
+++ b/hypervisor/src/mshv/mod.rs | ||
@@ -962,7 +962,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()))?; | ||
-- | ||
2.45.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters