From 83f22ac7794e227f387c32165a74738ffe7e06c1 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Wed, 19 Oct 2022 14:03:29 -0700 Subject: [PATCH] virtio-devices: iommu: Specify minimum number of queues to avoid OOB In this way, the virtio-iommu code can properly report an error when a wrong number of queues is provided, instead of triggering an out-of-bound error. Signed-off-by: Bo Chen --- virtio-devices/src/iommu.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/virtio-devices/src/iommu.rs b/virtio-devices/src/iommu.rs index e23fa71f7..ed03a3f12 100644 --- a/virtio-devices/src/iommu.rs +++ b/virtio-devices/src/iommu.rs @@ -905,6 +905,7 @@ impl Iommu { | 1u64 << VIRTIO_IOMMU_F_PROBE | 1u64 << VIRTIO_IOMMU_F_BYPASS_CONFIG, paused_sync: Some(Arc::new(Barrier::new(2))), + min_queues: NUM_QUEUES as u16, ..Default::default() }, config,