mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-15 16:12:58 +00:00
hv: fix NULL pointer dereference in "hcall_set_vm_memory_regions()"
'target_vm' returned from 'get_vm_from_vmid()' maybe NULL, passing to 'is_vm0()' without check. Tracked-On: #861 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
e913f9e613
commit
0c7e59f01e
@ -535,6 +535,10 @@ int32_t hcall_set_vm_memory_regions(struct vm *vm, uint64_t param)
|
||||
}
|
||||
|
||||
target_vm = get_vm_from_vmid(set_regions.vmid);
|
||||
if (target_vm == NULL) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (is_vm0(target_vm)) {
|
||||
pr_err("%s: Targeting to service vm", __func__);
|
||||
return -EFAULT;
|
||||
|
Loading…
Reference in New Issue
Block a user