From 643c549734ca45a0bc4e381b08cfd4fc886deffe Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 7 Aug 2015 16:36:38 +0200 Subject: [PATCH] virDomainDefParseXML: Check for malicious cpu ids in https://bugzilla.redhat.com/show_bug.cgi?id=1176020 Some users think this is a good idea: 4 It's not. Lets therefore introduce a check and discourage them in doing so. Signed-off-by: Michal Privoznik (cherry picked from commit 82af954c527e88111b05d50953b80eb4afde4d9a) --- src/conf/domain_conf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6b557d1481..0ce41884bc 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15070,6 +15070,12 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } + if (virDomainNumaGetMaxCPUID(def->numa) >= def->maxvcpus) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("CPU IDs in exceed the count")); + goto error; + } + if (virDomainNumatuneParseXML(def->numa, def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC,