mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-31 23:38:24 +00:00
local_gpa2hpa: INVALID_GPA also means failure of address conversion
Either INVALID_GPA or NULL returned from local_gpa2hpa means the page walk failure. But current code only take care of NULL and leave INVALID_GPA not detected. It could trigger ACRN crash in root mode when guest have a invalid gva. We add INVALID_GPA check as well. Tracked-On: #4721 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
parent
440385d53f
commit
e8d00c2cec
@ -443,5 +443,6 @@ int32_t copy_from_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
/* gpa --> hpa -->hva */
|
||||
void *gpa2hva(struct acrn_vm *vm, uint64_t x)
|
||||
{
|
||||
return hpa2hva(gpa2hpa(vm, x));
|
||||
uint64_t hpa = gpa2hpa(vm, x);
|
||||
return (hpa == INVALID_HPA) ? NULL : hpa2hva(hpa);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user