summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Tascioglu <tony.tascioglu@windriver.com>2021-05-14 09:14:49 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-22 10:03:10 +0100
commitcb3bc91a03fb6fbf3f849ad449274292270cb403 (patch)
tree9f51d0cf6fea66bdf99efc7d29a3393bb0965031
parentbbc1b0ebf719ca5352c2a8004d04a15954dea7cc (diff)
downloadpoky-cb3bc91a03fb6fbf3f849ad449274292270cb403.tar.gz
libxml2: fix CVE-2021-3516
Fixes use-after-free in xmlEncodeEntitiesInternal() in entities.c CVE: CVE-2021-3516 Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/1358d157d0bd83be1dfe356a69213df9fac0b539] (From OE-Core rev: 490cddd7baf1aacb814128b611aabf82fda3e77b) Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/libxml/libxml2/CVE-2021-3516.patch36
-rw-r--r--meta/recipes-core/libxml/libxml2_2.9.10.bb1
2 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-core/libxml/libxml2/CVE-2021-3516.patch b/meta/recipes-core/libxml/libxml2/CVE-2021-3516.patch
new file mode 100644
index 0000000000..287a171924
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/CVE-2021-3516.patch
@@ -0,0 +1,36 @@
1From b76718876953e11bbd73dc6c9457323fd5aeda2e Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Wed, 21 Apr 2021 13:23:27 +0200
4Subject: [PATCH 2/3] Fix use-after-free with `xmllint --html --push`
5
6Call htmlCtxtUseOptions to make sure that names aren't stored in
7dictionaries.
8
9Note that this issue only affects xmllint using the HTML push parser.
10
11Fixes #230.
12
13CVE: CVE-2021-3516
14Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/1358d157d0bd83be1dfe356a69213df9fac0b539]
15
16Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com>
17---
18 xmllint.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/xmllint.c b/xmllint.c
22index c0712674..ba66676b 100644
23--- a/xmllint.c
24+++ b/xmllint.c
25@@ -2204,7 +2204,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
26 if (res > 0) {
27 ctxt = htmlCreatePushParserCtxt(NULL, NULL,
28 chars, res, filename, XML_CHAR_ENCODING_NONE);
29- xmlCtxtUseOptions(ctxt, options);
30+ htmlCtxtUseOptions(ctxt, options);
31 while ((res = fread(chars, 1, pushsize, f)) > 0) {
32 htmlParseChunk(ctxt, chars, res, 0);
33 }
34--
352.25.1
36
diff --git a/meta/recipes-core/libxml/libxml2_2.9.10.bb b/meta/recipes-core/libxml/libxml2_2.9.10.bb
index ad612379b3..6f1229c2d0 100644
--- a/meta/recipes-core/libxml/libxml2_2.9.10.bb
+++ b/meta/recipes-core/libxml/libxml2_2.9.10.bb
@@ -25,6 +25,7 @@ SRC_URI = "http://www.xmlsoft.org/sources/libxml2-${PV}.tar.gz;name=libtar \
25 file://CVE-2020-24977.patch \ 25 file://CVE-2020-24977.patch \
26 file://fix-python39.patch \ 26 file://fix-python39.patch \
27 file://CVE-2021-3517.patch \ 27 file://CVE-2021-3517.patch \
28 file://CVE-2021-3516.patch \
28 " 29 "
29 30
30SRC_URI[libtar.md5sum] = "10942a1dc23137a8aa07f0639cbfece5" 31SRC_URI[libtar.md5sum] = "10942a1dc23137a8aa07f0639cbfece5"