mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 15:02:13 +00:00
hv: fix potential crash in write_protect_page()
This hypercall handler may result in hypervisor crash when an invalid 'gpa' is set, e.g. set its top reserved bits. This patch adds one more sanity check on input 'gpa' address from service VM to avoid potential hypervisor crash. Tracked-On: #5802 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
6ec26987da
commit
605b169584
@ -679,6 +679,7 @@ static int32_t write_protect_page(struct acrn_vm *vm,const struct wp_data *wp)
|
||||
|
||||
if (is_severity_pass(vm->vm_id)) {
|
||||
if ((!mem_aligned_check(wp->gpa, PAGE_SIZE)) ||
|
||||
(!ept_is_mr_valid(vm, wp->gpa, PAGE_SIZE)) ||
|
||||
(!ept_is_valid_mr(vm, wp->gpa, PAGE_SIZE))) {
|
||||
pr_err("%s,vm[%hu] gpa 0x%lx,GPA is invalid or not page size aligned.",
|
||||
__func__, vm->vm_id, wp->gpa);
|
||||
|
Loading…
Reference in New Issue
Block a user