summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorOvidiu Panait <ovidiu.panait@windriver.com>2020-09-09 11:11:53 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-10 13:48:26 +0100
commit592a9e75f7453fbc969093a848532b190e389905 (patch)
tree41c3a76020357989524f2ba926bdab49562156c4 /meta
parent34eee398f9ea8f0c57dfa476cdf2c91262b34893 (diff)
downloadpoky-592a9e75f7453fbc969093a848532b190e389905.tar.gz
libxml2: Fix CVE-2020-24977
GNOME project libxml2 v2.9.10 and earlier have a global Buffer Overflow vulnerability in xmlEncodeEntitiesInternal at libxml2/entities.c. The issue has been fixed in commit 8e7c20a1 (20910-GITv2.9.10-103-g8e7c20a1). Reference: https://gitlab.gnome.org/GNOME/libxml2/-/issues/178 Upstream patch: https://gitlab.gnome.org/GNOME/libxml2/-/commit/50f06b3efb638efb0abd95dc62dca05ae67882c2 (From OE-Core rev: 92dc02b8f03f3586de0a2ec1463b189a3918e303) Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/libxml/libxml2/CVE-2020-24977.patch41
-rw-r--r--meta/recipes-core/libxml/libxml2_2.9.10.bb1
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-core/libxml/libxml2/CVE-2020-24977.patch b/meta/recipes-core/libxml/libxml2/CVE-2020-24977.patch
new file mode 100644
index 0000000000..8224346660
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/CVE-2020-24977.patch
@@ -0,0 +1,41 @@
1From 50f06b3efb638efb0abd95dc62dca05ae67882c2 Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Fri, 7 Aug 2020 21:54:27 +0200
4Subject: [PATCH] Fix out-of-bounds read with 'xmllint --htmlout'
5
6Make sure that truncated UTF-8 sequences don't cause an out-of-bounds
7array access.
8
9Thanks to @SuhwanSong and the Agency for Defense Development (ADD) for
10the report.
11
12Fixes #178.
13
14CVE: CVE-2020-24977
15Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/50f06b3efb638efb0abd95dc62dca05ae67882c2]
16
17Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
18---
19 xmllint.c | 6 ++++++
20 1 file changed, 6 insertions(+)
21
22diff --git a/xmllint.c b/xmllint.c
23index f6a8e463..c647486f 100644
24--- a/xmllint.c
25+++ b/xmllint.c
26@@ -528,6 +528,12 @@ static void
27 xmlHTMLEncodeSend(void) {
28 char *result;
29
30+ /*
31+ * xmlEncodeEntitiesReentrant assumes valid UTF-8, but the buffer might
32+ * end with a truncated UTF-8 sequence. This is a hack to at least avoid
33+ * an out-of-bounds read.
34+ */
35+ memset(&buffer[sizeof(buffer)-4], 0, 4);
36 result = (char *) xmlEncodeEntitiesReentrant(NULL, BAD_CAST buffer);
37 if (result) {
38 xmlGenericError(xmlGenericErrorContext, "%s", result);
39--
402.17.1
41
diff --git a/meta/recipes-core/libxml/libxml2_2.9.10.bb b/meta/recipes-core/libxml/libxml2_2.9.10.bb
index d11b083e8b..90890ffaed 100644
--- a/meta/recipes-core/libxml/libxml2_2.9.10.bb
+++ b/meta/recipes-core/libxml/libxml2_2.9.10.bb
@@ -22,6 +22,7 @@ SRC_URI = "http://www.xmlsoft.org/sources/libxml2-${PV}.tar.gz;name=libtar \
22 file://fix-execution-of-ptests.patch \ 22 file://fix-execution-of-ptests.patch \
23 file://CVE-2020-7595.patch \ 23 file://CVE-2020-7595.patch \
24 file://CVE-2019-20388.patch \ 24 file://CVE-2019-20388.patch \
25 file://CVE-2020-24977.patch \
25 " 26 "
26 27
27SRC_URI[libtar.md5sum] = "10942a1dc23137a8aa07f0639cbfece5" 28SRC_URI[libtar.md5sum] = "10942a1dc23137a8aa07f0639cbfece5"