diff options
author | Ralph Siemsen <ralph.siemsen@linaro.org> | 2022-03-25 11:36:43 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-31 21:09:33 +0100 |
commit | 82abf31270b6a9a95d2797ce9fa3408fcc01ceb8 (patch) | |
tree | 49b88fa073558dc97054b2b5c0dcce616d2b2f61 | |
parent | a27aa2316f383735d5c4cba7f7e502bff579979b (diff) | |
download | poky-82abf31270b6a9a95d2797ce9fa3408fcc01ceb8.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: 906ffe5bf83c0e587299aaedb9382ce04c3c7acf)
Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch | 98 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2_2.9.10.bb | 1 |
2 files changed, 99 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..7fc243eec1 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch | |||
@@ -0,0 +1,98 @@ | |||
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: Ralph Siemsen <ralph.siemsen@linaro.org> | ||
19 | |||
20 | diff --git a/valid.c b/valid.c | ||
21 | index 8e596f1d..9684683a 100644 | ||
22 | --- a/valid.c | ||
23 | +++ b/valid.c | ||
24 | @@ -479,35 +479,6 @@ nodeVPop(xmlValidCtxtPtr ctxt) | ||
25 | return (ret); | ||
26 | } | ||
27 | |||
28 | -/** | ||
29 | - * xmlValidNormalizeString: | ||
30 | - * @str: a string | ||
31 | - * | ||
32 | - * Normalize a string in-place. | ||
33 | - */ | ||
34 | -static void | ||
35 | -xmlValidNormalizeString(xmlChar *str) { | ||
36 | - xmlChar *dst; | ||
37 | - const xmlChar *src; | ||
38 | - | ||
39 | - if (str == NULL) | ||
40 | - return; | ||
41 | - src = str; | ||
42 | - dst = str; | ||
43 | - | ||
44 | - while (*src == 0x20) src++; | ||
45 | - while (*src != 0) { | ||
46 | - if (*src == 0x20) { | ||
47 | - while (*src == 0x20) src++; | ||
48 | - if (*src != 0) | ||
49 | - *dst++ = 0x20; | ||
50 | - } else { | ||
51 | - *dst++ = *src++; | ||
52 | - } | ||
53 | - } | ||
54 | - *dst = 0; | ||
55 | -} | ||
56 | - | ||
57 | #ifdef DEBUG_VALID_ALGO | ||
58 | static void | ||
59 | xmlValidPrintNode(xmlNodePtr cur) { | ||
60 | @@ -2636,6 +2607,35 @@ xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) { | ||
61 | (xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \ | ||
62 | xmlFree((char *)(str)); | ||
63 | |||
64 | +/** | ||
65 | + * xmlValidNormalizeString: | ||
66 | + * @str: a string | ||
67 | + * | ||
68 | + * Normalize a string in-place. | ||
69 | + */ | ||
70 | +static void | ||
71 | +xmlValidNormalizeString(xmlChar *str) { | ||
72 | + xmlChar *dst; | ||
73 | + const xmlChar *src; | ||
74 | + | ||
75 | + if (str == NULL) | ||
76 | + return; | ||
77 | + src = str; | ||
78 | + dst = str; | ||
79 | + | ||
80 | + while (*src == 0x20) src++; | ||
81 | + while (*src != 0) { | ||
82 | + if (*src == 0x20) { | ||
83 | + while (*src == 0x20) src++; | ||
84 | + if (*src != 0) | ||
85 | + *dst++ = 0x20; | ||
86 | + } else { | ||
87 | + *dst++ = *src++; | ||
88 | + } | ||
89 | + } | ||
90 | + *dst = 0; | ||
91 | +} | ||
92 | + | ||
93 | static int | ||
94 | xmlIsStreaming(xmlValidCtxtPtr ctxt) { | ||
95 | xmlParserCtxtPtr pctxt; | ||
96 | -- | ||
97 | 2.35.1 | ||
98 | |||
diff --git a/meta/recipes-core/libxml/libxml2_2.9.10.bb b/meta/recipes-core/libxml/libxml2_2.9.10.bb index c45cf4423e..c4bb8f29e0 100644 --- a/meta/recipes-core/libxml/libxml2_2.9.10.bb +++ b/meta/recipes-core/libxml/libxml2_2.9.10.bb | |||
@@ -29,6 +29,7 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;subdir=${BP};name=te | |||
29 | file://CVE-2021-3518.patch \ | 29 | file://CVE-2021-3518.patch \ |
30 | file://CVE-2021-3541.patch \ | 30 | file://CVE-2021-3541.patch \ |
31 | file://CVE-2022-23308.patch \ | 31 | file://CVE-2022-23308.patch \ |
32 | file://CVE-2022-23308-fix-regression.patch \ | ||
32 | " | 33 | " |
33 | 34 | ||
34 | SRC_URI[archive.sha256sum] = "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813" | 35 | SRC_URI[archive.sha256sum] = "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813" |