diff options
-rw-r--r-- | xen/drivers/passthrough/amd/iommu_acpi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c index 73524384c2..0aeeb30737 100644 --- a/xen/drivers/passthrough/amd/iommu_acpi.c +++ b/xen/drivers/passthrough/amd/iommu_acpi.c @@ -677,6 +677,13 @@ static u16 __init parse_ivhd_device_special( if ( IO_APIC_ID(apic) != ivhd_device->special.handle ) continue; + if ( ivhd_device->special.handle >= MAX_IO_APICS ) + { + printk(XENLOG_ERR "IVHD Error: IO-APIC %#x entry beyond bounds\n", + ivhd_device->special.handle); + return 0; + } + if ( ioapic_bdf[ivhd_device->special.handle].pin_setup ) { if ( ioapic_bdf[ivhd_device->special.handle].bdf == bdf ) |