From 0abe94ddc51e964eec027d22637381f274f8b133 Mon Sep 17 00:00:00 2001 From: Sona Sarmadi Date: Wed, 24 Feb 2016 09:07:42 +0100 Subject: libxml2: CVE-2015-8317 Fixes out-of-bounds heap read when parsing file with unfinished xml declaration. Reference: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-8317 Signed-off-by: Sona Sarmadi Signed-off-by: Tudor Florea --- meta/recipes-core/libxml/libxml2.inc | 1 + ...ng-early-on-if-encoding-conversion-failed.patch | 42 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 meta/recipes-core/libxml/libxml2/CVE-2015-8317-Fail-parsing-early-on-if-encoding-conversion-failed.patch diff --git a/meta/recipes-core/libxml/libxml2.inc b/meta/recipes-core/libxml/libxml2.inc index 2dafeb446d..2dc4d575f6 100644 --- a/meta/recipes-core/libxml/libxml2.inc +++ b/meta/recipes-core/libxml/libxml2.inc @@ -26,6 +26,7 @@ SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \ file://CVE-2015-7942.patch \ file://CVE-2015-8035.patch \ file://CVE-2015-8241.patch \ + file://CVE-2015-8317-Fail-parsing-early-on-if-encoding-conversion-failed.patch \ " BINCONFIG = "${bindir}/xml2-config" diff --git a/meta/recipes-core/libxml/libxml2/CVE-2015-8317-Fail-parsing-early-on-if-encoding-conversion-failed.patch b/meta/recipes-core/libxml/libxml2/CVE-2015-8317-Fail-parsing-early-on-if-encoding-conversion-failed.patch new file mode 100644 index 0000000000..a5eee02bc2 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/CVE-2015-8317-Fail-parsing-early-on-if-encoding-conversion-failed.patch @@ -0,0 +1,42 @@ +From 709a952110e98621c9b78c4f26462a9d8333102e Mon Sep 17 00:00:00 2001 +From: Daniel Veillard +Date: Mon, 29 Jun 2015 16:10:26 +0800 +Subject: [PATCH] Fail parsing early on if encoding conversion failed + +For https://bugzilla.gnome.org/show_bug.cgi?id=751631 + +If we fail conversing the current input stream while +processing the encoding declaration of the XMLDecl +then it's safer to just abort there and not try to +report further errors. + +Upstream-Status: Backport + +CVE: CVE-2015-8317 + +Signed-off-by: Armin Kuster + +--- + parser.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/parser.c b/parser.c +index a3a9568..0edd53b 100644 +--- a/parser.c ++++ b/parser.c +@@ -10471,7 +10471,11 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) { + + handler = xmlFindCharEncodingHandler((const char *) encoding); + if (handler != NULL) { +- xmlSwitchToEncoding(ctxt, handler); ++ if (xmlSwitchToEncoding(ctxt, handler) < 0) { ++ /* failed to convert */ ++ ctxt->errNo = XML_ERR_UNSUPPORTED_ENCODING; ++ return(NULL); ++ } + } else { + xmlFatalErrMsgStr(ctxt, XML_ERR_UNSUPPORTED_ENCODING, + "Unsupported encoding %s\n", encoding); +-- +2.3.5 + -- cgit v1.2.3-54-g00ecf