linux/drivers/virt/acrn
Shuo Liu 4c4c1257b8 virt: acrn: Do hcall_destroy_vm() before resource release
The ACRN hypervisor has scenarios which could run a real-time guest VM.
The real-time guest VM occupies dedicated CPU cores, be assigned with
dedicated PCI devices. It can run without the Service VM after boot up.
hcall_destroy_vm() returns failure when a real-time guest VM refuses.
The clearing of flag ACRN_VM_FLAG_DESTROYED causes some kernel resource
double-freed in a later acrn_vm_destroy().

Do hcall_destroy_vm() before resource release to drop this chance to
destroy the VM if hypercall fails.

Fixes: 9c5137aedd ("virt: acrn: Introduce VM management interfaces")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
Link: https://lore.kernel.org/r/20210722062736.15050-1-fei1.li@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-27 16:48:45 +02:00
..
acrn_drv.h virt: acrn: Introduce irqfd 2021-02-09 10:58:19 +01:00
hsm.c virt: acrn: Correct type casting of argument of copy_from_user() 2021-03-10 16:59:50 +01:00
hypercall.h virt: acrn: Introduce an interface for Service VM to control vCPU 2021-02-09 10:58:19 +01:00
ioeventfd.c virt: acrn: Introduce ioeventfd 2021-02-09 10:58:19 +01:00
ioreq.c virt: acrn: Introduce I/O ranges operation interfaces 2021-02-09 10:58:19 +01:00
irqfd.c virt: acrn: Use EPOLLIN instead of POLLIN 2021-03-10 09:50:23 +01:00
Kconfig virt: acrn: Introduce ioeventfd 2021-02-09 10:58:19 +01:00
Makefile virt: acrn: Introduce irqfd 2021-02-09 10:58:19 +01:00
mm.c virt: acrn: Introduce EPT mapping management 2021-02-09 10:58:19 +01:00
vm.c virt: acrn: Do hcall_destroy_vm() before resource release 2021-07-27 16:48:45 +02:00