diff options
author | Joe Slater <joe.slater@windriver.com> | 2022-03-24 12:20:35 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-26 09:33:32 +0000 |
commit | 1e94dfcb04764d0d08de37437fe9d6fdfa534d85 (patch) | |
tree | 10bfb49f22137c57366c5a9fba9918a5874dd8e9 /meta/recipes-core | |
parent | 075aeeff2bb5be176e6d58ad3f1e7b7fb2d5b762 (diff) | |
download | poky-1e94dfcb04764d0d08de37437fe9d6fdfa534d85.tar.gz |
libxml2: fix CVE-2022-23308 regression
The fix for the CVE in 2.9.13 caused a regression which
was addressed after 2.9.13. We import that patch here.
(From OE-Core rev: f7fd194feb4f7993518388160acd5199fcfc3b26)
Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch | 99 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2_2.9.13.bb | 3 |
2 files changed, 102 insertions, 0 deletions
diff --git a/meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch b/meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch new file mode 100644 index 0000000000..e188914613 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | From 646fe48d1c8a74310c409ddf81fe7df6700052af Mon Sep 17 00:00:00 2001 | ||
2 | From: Nick Wellnhofer <wellnhofer@aevum.de> | ||
3 | Date: Tue, 22 Feb 2022 11:51:08 +0100 | ||
4 | Subject: [PATCH] Fix --without-valid build | ||
5 | |||
6 | Regressed in commit 652dd12a. | ||
7 | --- | ||
8 | valid.c | 58 ++++++++++++++++++++++++++++----------------------------- | ||
9 | 1 file changed, 29 insertions(+), 29 deletions(-) | ||
10 | --- | ||
11 | |||
12 | From https://github.com/GNOME/libxml2.git | ||
13 | commit 646fe48d1c8a74310c409ddf81fe7df6700052af | ||
14 | |||
15 | CVE: CVE-2022-23308 | ||
16 | Upstream-Status: Backport | ||
17 | |||
18 | Signed-off-by: Joe Slater <joe.slater@windriver.com> | ||
19 | |||
20 | |||
21 | diff --git a/valid.c b/valid.c | ||
22 | index 8e596f1d..9684683a 100644 | ||
23 | --- a/valid.c | ||
24 | +++ b/valid.c | ||
25 | @@ -479,35 +479,6 @@ nodeVPop(xmlValidCtxtPtr ctxt) | ||
26 | return (ret); | ||
27 | } | ||
28 | |||
29 | -/** | ||
30 | - * xmlValidNormalizeString: | ||
31 | - * @str: a string | ||
32 | - * | ||
33 | - * Normalize a string in-place. | ||
34 | - */ | ||
35 | -static void | ||
36 | -xmlValidNormalizeString(xmlChar *str) { | ||
37 | - xmlChar *dst; | ||
38 | - const xmlChar *src; | ||
39 | - | ||
40 | - if (str == NULL) | ||
41 | - return; | ||
42 | - src = str; | ||
43 | - dst = str; | ||
44 | - | ||
45 | - while (*src == 0x20) src++; | ||
46 | - while (*src != 0) { | ||
47 | - if (*src == 0x20) { | ||
48 | - while (*src == 0x20) src++; | ||
49 | - if (*src != 0) | ||
50 | - *dst++ = 0x20; | ||
51 | - } else { | ||
52 | - *dst++ = *src++; | ||
53 | - } | ||
54 | - } | ||
55 | - *dst = 0; | ||
56 | -} | ||
57 | - | ||
58 | #ifdef DEBUG_VALID_ALGO | ||
59 | static void | ||
60 | xmlValidPrintNode(xmlNodePtr cur) { | ||
61 | @@ -2636,6 +2607,35 @@ xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) { | ||
62 | (xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \ | ||
63 | xmlFree((char *)(str)); | ||
64 | |||
65 | +/** | ||
66 | + * xmlValidNormalizeString: | ||
67 | + * @str: a string | ||
68 | + * | ||
69 | + * Normalize a string in-place. | ||
70 | + */ | ||
71 | +static void | ||
72 | +xmlValidNormalizeString(xmlChar *str) { | ||
73 | + xmlChar *dst; | ||
74 | + const xmlChar *src; | ||
75 | + | ||
76 | + if (str == NULL) | ||
77 | + return; | ||
78 | + src = str; | ||
79 | + dst = str; | ||
80 | + | ||
81 | + while (*src == 0x20) src++; | ||
82 | + while (*src != 0) { | ||
83 | + if (*src == 0x20) { | ||
84 | + while (*src == 0x20) src++; | ||
85 | + if (*src != 0) | ||
86 | + *dst++ = 0x20; | ||
87 | + } else { | ||
88 | + *dst++ = *src++; | ||
89 | + } | ||
90 | + } | ||
91 | + *dst = 0; | ||
92 | +} | ||
93 | + | ||
94 | static int | ||
95 | xmlIsStreaming(xmlValidCtxtPtr ctxt) { | ||
96 | xmlParserCtxtPtr pctxt; | ||
97 | -- | ||
98 | 2.35.1 | ||
99 | |||
diff --git a/meta/recipes-core/libxml/libxml2_2.9.13.bb b/meta/recipes-core/libxml/libxml2_2.9.13.bb index be59aba84b..e361b53bfd 100644 --- a/meta/recipes-core/libxml/libxml2_2.9.13.bb +++ b/meta/recipes-core/libxml/libxml2_2.9.13.bb | |||
@@ -23,6 +23,9 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;subdir=${BP};name=te | |||
23 | file://remove-fuzz-from-ptests.patch \ | 23 | file://remove-fuzz-from-ptests.patch \ |
24 | file://libxml-m4-use-pkgconfig.patch \ | 24 | file://libxml-m4-use-pkgconfig.patch \ |
25 | " | 25 | " |
26 | # will be in v2.9.14 | ||
27 | # | ||
28 | SRC_URI += "file://CVE-2022-23308-fix-regression.patch" | ||
26 | 29 | ||
27 | SRC_URI[archive.sha256sum] = "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e" | 30 | SRC_URI[archive.sha256sum] = "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e" |
28 | SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7" | 31 | SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7" |