diff mbox series

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

Message ID 20201001114407.44532-1-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series xen/domain: check IOMMU options doesn't contain unknown bits set | expand

Commit Message

Roger Pau Monné Oct. 1, 2020, 11:44 a.m. UTC
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/common/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jan Beulich Oct. 1, 2020, 11:51 a.m. UTC | #1
On 01.10.2020 13:44, Roger Pau Monne wrote:
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8cfa2e0b6b..c4a480fa14 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -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,