hv: fix vulnerability when VM is destroyed

In hypervisor fuzzing test, hypervisor will hang
 if issuing HV_VM_SET_MEMORY_REGIONS hypercall after
 target VM is destroyed.

 this patch is to fix above vulnerability.

Tracked-On: #2849
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yonghua Huang
2019-03-26 01:37:46 +08:00
committed by ACRN System Integration
parent 5a7be9b869
commit 868778a68b
3 changed files with 9 additions and 8 deletions

View File

@@ -448,6 +448,8 @@ int32_t shutdown_vm(struct acrn_vm *vm)
/* Only allow shutdown paused vm */
if (vm->state == VM_PAUSED) {
vm->state = VM_STATE_INVALID;
foreach_vcpu(i, vm, vcpu) {
reset_vcpu(vcpu);
offline_vcpu(vcpu);