mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
gpa2hva: add INVAVLID_HPA return value check
For return value of local_gpa2hpa, either INVALID_HPA or NULL means the EPT walking failure. Current code only take care of NULL return and leave INVALID_HPA as correct case. In some cases (if guest page table is filled with invalid memory address), it could crash ACRN from guest. Add INVALID_HPA return check as well. Also add @pre assumptions for some gpa2hpa usages. Tracked-On: #4730 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
@@ -55,6 +55,7 @@ static uint32_t create_zeropage_e820(struct zero_page *zp, const struct acrn_vm
|
||||
|
||||
/**
|
||||
* @pre vm != NULL
|
||||
* @pre (vm->min_mem_addr <= kernel_load_addr) && (kernel_load_addr < vm->max_mem_addr)
|
||||
*/
|
||||
static uint64_t create_zero_page(struct acrn_vm *vm)
|
||||
{
|
||||
|
Reference in New Issue
Block a user