From 59b27f360e3d9dc0378c1288e67a91fa41a77158 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roger=20Pau=20Monn=C3=A9?= Date: Fri, 2 Oct 2020 08:38:50 +0200 Subject: [PATCH] xen/domain: check IOMMU options doesn't contain unknown bits set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich --- xen/common/domain.c | 6 ++++++ 1 file changed, 6 insertions(+) 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, -- 2.30.2