summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2025-07-28 22:19:19 +0200
committerSteve Sakoman <steve@sakoman.com>2025-08-04 06:40:00 -0700
commit7a75b9b4a7b8ae30d4dae646f3228b57e93be9b2 (patch)
tree694cd7311e083e9d11777e48b116d9a36aea4031
parent1e39b807b7bd53bf65d22c2baaf8747f55676c83 (diff)
downloadpoky-7a75b9b4a7b8ae30d4dae646f3228b57e93be9b2.tar.gz
libxml2: patch CVE-2025-6170
Pick commit referencing this CVE from 2.13 branch. (From OE-Core rev: 9418c88c964dffc21abe6a056db72c3c81e25137) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-core/libxml/libxml2/CVE-2025-6170.patch103
-rw-r--r--meta/recipes-core/libxml/libxml2_2.9.14.bb1
2 files changed, 104 insertions, 0 deletions
diff --git a/meta/recipes-core/libxml/libxml2/CVE-2025-6170.patch b/meta/recipes-core/libxml/libxml2/CVE-2025-6170.patch
new file mode 100644
index 0000000000..a63ae1cff7
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/CVE-2025-6170.patch
@@ -0,0 +1,103 @@
1From 5e9ec5c107d3f5b5179c3dbc19df43df041cd55b Mon Sep 17 00:00:00 2001
2From: Michael Mann <mmann78@netscape.net>
3Date: Fri, 20 Jun 2025 23:05:00 -0400
4Subject: [PATCH] [CVE-2025-6170] Fix potential buffer overflows of interactive
5 shell
6
7Fixes #941
8
9CVE: CVE-2025-6170
10Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/5e9ec5c107d3f5b5179c3dbc19df43df041cd55b]
11Signed-off-by: Peter Marko <peter.marko@siemens.com>
12---
13 debugXML.c | 15 ++++++++++-----
14 result/scripts/long_command | 8 ++++++++
15 test/scripts/long_command.script | 6 ++++++
16 test/scripts/long_command.xml | 1 +
17 4 files changed, 25 insertions(+), 5 deletions(-)
18 create mode 100644 result/scripts/long_command
19 create mode 100644 test/scripts/long_command.script
20 create mode 100644 test/scripts/long_command.xml
21
22diff --git a/debugXML.c b/debugXML.c
23index ed56b0f8..452b9573 100644
24--- a/debugXML.c
25+++ b/debugXML.c
26@@ -1050,6 +1050,10 @@ xmlCtxtDumpOneNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
27 xmlCtxtGenericNodeCheck(ctxt, node);
28 }
29
30+#define MAX_PROMPT_SIZE 500
31+#define MAX_ARG_SIZE 400
32+#define MAX_COMMAND_SIZE 100
33+
34 /**
35 * xmlCtxtDumpNode:
36 * @output: the FILE * for the output
37@@ -2802,10 +2806,10 @@ void
38 xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
39 FILE * output)
40 {
41- char prompt[500] = "/ > ";
42+ char prompt[MAX_PROMPT_SIZE] = "/ > ";
43 char *cmdline = NULL, *cur;
44- char command[100];
45- char arg[400];
46+ char command[MAX_COMMAND_SIZE];
47+ char arg[MAX_ARG_SIZE];
48 int i;
49 xmlShellCtxtPtr ctxt;
50 xmlXPathObjectPtr list;
51@@ -2863,7 +2867,8 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
52 cur++;
53 i = 0;
54 while ((*cur != ' ') && (*cur != '\t') &&
55- (*cur != '\n') && (*cur != '\r')) {
56+ (*cur != '\n') && (*cur != '\r') &&
57+ (i < (MAX_COMMAND_SIZE - 1))) {
58 if (*cur == 0)
59 break;
60 command[i++] = *cur++;
61@@ -2878,7 +2883,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
62 while ((*cur == ' ') || (*cur == '\t'))
63 cur++;
64 i = 0;
65- while ((*cur != '\n') && (*cur != '\r') && (*cur != 0)) {
66+ while ((*cur != '\n') && (*cur != '\r') && (*cur != 0) && (i < (MAX_ARG_SIZE-1))) {
67 if (*cur == 0)
68 break;
69 arg[i++] = *cur++;
70diff --git a/result/scripts/long_command b/result/scripts/long_command
71new file mode 100644
72index 00000000..e6f00708
73--- /dev/null
74+++ b/result/scripts/long_command
75@@ -0,0 +1,8 @@
76+/ > b > b > Object is a Node Set :
77+Set contains 1 nodes:
78+1 ELEMENT a:c
79+b > Unknown command This_is_a_really_long_command_string_designed_to_test_the_limits_of_the_memory_that_stores_the_comm
80+b > b > Unknown command ess_currents_of_time_and_existence
81+b > <?xml version="1.0"?>
82+<a xmlns:a="bar"><b xmlns:a="foo">Navigating_the_labyrinthine_corridors_of_human_cognition_one_often_encounters_the_perplexing_paradox_that_the_more_we_delve_into_the_intricate_dance_of_neural_pathways_and_synaptic_firings_the_further_we_seem_to_stray_from_a_truly_holistic_understanding_of_consciousness_a_phenomenon_that_remains_as_elusive_as_a_moonbeam_caught_in_a_spiderweb_yet_undeniably_shapes_every_fleeting_thought_every_prof</b></a>
83+b >
84\ No newline at end of file
85diff --git a/test/scripts/long_command.script b/test/scripts/long_command.script
86new file mode 100644
87index 00000000..00f6df09
88--- /dev/null
89+++ b/test/scripts/long_command.script
90@@ -0,0 +1,6 @@
91+cd a/b
92+set <a:c/>
93+xpath //*[namespace-uri()="foo"]
94+This_is_a_really_long_command_string_designed_to_test_the_limits_of_the_memory_that_stores_the_command_please_dont_crash foo
95+set Navigating_the_labyrinthine_corridors_of_human_cognition_one_often_encounters_the_perplexing_paradox_that_the_more_we_delve_into_the_intricate_dance_of_neural_pathways_and_synaptic_firings_the_further_we_seem_to_stray_from_a_truly_holistic_understanding_of_consciousness_a_phenomenon_that_remains_as_elusive_as_a_moonbeam_caught_in_a_spiderweb_yet_undeniably_shapes_every_fleeting_thought_every_profound_emotion_and_every_grand_aspiration_that_propels_our_species_ever_onward_through_the_relentless_currents_of_time_and_existence
96+save -
97diff --git a/test/scripts/long_command.xml b/test/scripts/long_command.xml
98new file mode 100644
99index 00000000..1ba44016
100--- /dev/null
101+++ b/test/scripts/long_command.xml
102@@ -0,0 +1 @@
103+<a xmlns:a="bar"><b xmlns:a="foo"/></a>
diff --git a/meta/recipes-core/libxml/libxml2_2.9.14.bb b/meta/recipes-core/libxml/libxml2_2.9.14.bb
index baac155270..f34b0c25ca 100644
--- a/meta/recipes-core/libxml/libxml2_2.9.14.bb
+++ b/meta/recipes-core/libxml/libxml2_2.9.14.bb
@@ -41,6 +41,7 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar;subdir=${BP};name=testt
41 file://CVE-2025-32415.patch \ 41 file://CVE-2025-32415.patch \
42 file://CVE-2025-6021.patch \ 42 file://CVE-2025-6021.patch \
43 file://CVE-2025-49794-CVE-2025-49796.patch \ 43 file://CVE-2025-49794-CVE-2025-49796.patch \
44 file://CVE-2025-6170.patch \
44 " 45 "
45 46
46SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" 47SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee"