From: Ján Tomko Date: Thu, 11 Feb 2016 09:55:07 +0000 (+0100) Subject: Error out on missing machine type in machine configs X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=55e6d8cd9eac7eb2aaa4d221585e9402cf7269d5;p=libvirt.git Error out on missing machine type in machine configs Commit f1a89a8 allowed parsing configs from /etc/libvirt without validating the emulator capabilities. Check for the presence of os->type.machine even if the VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS flag is set, otherwise the daemon can crash on carelessly crafted input in the config directory. https://bugzilla.redhat.com/show_bug.cgi?id=1267256 --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0d2957b69c..acd58a1b61 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14841,6 +14841,12 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } VIR_FREE(capsdata); + } else { + if (!def->os.machine) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Missing machine type")); + goto error; + } } /* Extract domain name */