From 9f53426654e9a75a085901ca33fe1ea8173e7b7f Mon Sep 17 00:00:00 2001 From: Sona Sarmadi Date: Tue, 5 Apr 2016 12:34:36 +0200 Subject: libxml2: CVE-2015-8710 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit out-of-bounds memory access when parsing an unclosed HTML comment Link to the libxml2's bugtracker: https://bugzilla.gnome.org/show_bug.cgi?id=746048 Patch is backported from: http://git.yoctoproject.org/cgit/cgit.cgi/poky/ patch/?id=1bbf18385b76eccb2a413d72088d1ba66acaac02 Signed-off-by: Sona Sarmadi Signed-off-by: Nora Björklund --- meta/recipes-core/libxml/libxml2.inc | 1 + .../libxml/libxml2/CVE-2015-8710.patch | 71 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 meta/recipes-core/libxml/libxml2/CVE-2015-8710.patch diff --git a/meta/recipes-core/libxml/libxml2.inc b/meta/recipes-core/libxml/libxml2.inc index 08d7961241..afb193ca34 100644 --- a/meta/recipes-core/libxml/libxml2.inc +++ b/meta/recipes-core/libxml/libxml2.inc @@ -30,6 +30,7 @@ SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \ file://CVE-2015-8242-Buffer-overead-with-HTML-parser.patch \ file://Fix-a-bug-on-name-parsing-at-the-end-of-current-input.patch \ file://CVE-2015-7500-Fix-memory-access-error-due-to-incorre.patch \ + file://CVE-2015-8710.patch \ " BINCONFIG = "${bindir}/xml2-config" diff --git a/meta/recipes-core/libxml/libxml2/CVE-2015-8710.patch b/meta/recipes-core/libxml/libxml2/CVE-2015-8710.patch new file mode 100644 index 0000000000..71609c4c9f --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/CVE-2015-8710.patch @@ -0,0 +1,71 @@ +From e724879d964d774df9b7969fc846605aa1bac54c Mon Sep 17 00:00:00 2001 +From: Daniel Veillard +Date: Fri, 30 Oct 2015 21:14:55 +0800 +Subject: [PATCH] Fix parsing short unclosed comment uninitialized access + +For https://bugzilla.gnome.org/show_bug.cgi?id=746048 +The HTML parser was too optimistic when processing comments and +didn't check for the end of the stream on the first 2 characters + +Upstream-Status: Backport + +https://git.gnome.org/browse/libxml2/commit/?id=e724879d964d774df9b7969fc846605aa1bac54c + +CVE: CVE-2015-8710 + +Signed-off-by: Armin Kuster +igned-off-by: Sona Sarmadi +--- + HTMLparser.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +Index: libxml2-2.9.2/HTMLparser.c +=================================================================== +--- libxml2-2.9.2.orig/HTMLparser.c ++++ libxml2-2.9.2/HTMLparser.c +@@ -3245,12 +3245,17 @@ htmlParseComment(htmlParserCtxtPtr ctxt) + ctxt->instate = state; + return; + } ++ len = 0; ++ buf[len] = 0; + q = CUR_CHAR(ql); ++ if (!IS_CHAR(q)) ++ goto unfinished; + NEXTL(ql); + r = CUR_CHAR(rl); ++ if (!IS_CHAR(r)) ++ goto unfinished; + NEXTL(rl); + cur = CUR_CHAR(l); +- len = 0; + while (IS_CHAR(cur) && + ((cur != '>') || + (r != '-') || (q != '-'))) { +@@ -3281,18 +3286,20 @@ htmlParseComment(htmlParserCtxtPtr ctxt) + } + } + buf[len] = 0; +- if (!IS_CHAR(cur)) { +- htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, +- "Comment not terminated \n