mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-07 19:24:34 +00:00
hv: check the validity of 'pdev' in 'set_ptdev_intr_info'
This patch checks the validity of 'vdev->pdev' to ensure physical device is linked to 'vdev'. this check is to avoid some potential hypervisor crash when destroying VM with crafted input. Tracked-On: #4336 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Reviewed-by: Fei Li <fei1.li@intel.com>
This commit is contained in:
parent
fe03d8700d
commit
82b89fd04c
@ -581,7 +581,7 @@ void vpci_set_ptdev_intr_info(struct acrn_vm *target_vm, uint16_t vbdf, uint16_t
|
||||
sos_vm = get_sos_vm();
|
||||
spinlock_obtain(&sos_vm->vpci.lock);
|
||||
vdev = pci_find_vdev(&sos_vm->vpci, bdf);
|
||||
if (vdev == NULL) {
|
||||
if ((vdev == NULL) || (vdev->pdev == NULL)) {
|
||||
pr_err("%s, can't find PCI device for vm%d, vbdf (0x%x) pbdf (0x%x)", __func__,
|
||||
target_vm->vm_id, vbdf, pbdf);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user