Skip to contentSkip to conversation

xen/domain: check IOMMU options doesn't contain unknown bits set

PATCH In review Roger Pau Monne 2 participants 2 messages Oct 1, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/domain: check IOMMU options doesn't contain unknown bits set

---
 xen/common/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)
xen/common/domain.c +6 -0
index 8cfa2e0b6b..c4a480fa14 100644
@@ -310,6 +310,12 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
+    {
+        dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n", config->iommu_opts);
+        return -EINVAL;
+    }
+
     if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts )
     {
         dprintk(XENLOG_INFO,
Signature · 1 line
2.28.0