Complete Yocto mirror with license table for TQMa6UL (2038-compliance)
- 264 license table entries with exact download URLs (224/264 resolved) - Complete sources/ directory with all BitBake recipes - Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl) - Full traceability for Softwarefreigabeantrag - GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4 - License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
From d7657811964eac1cb9743bb98649278ad948f0d2 Mon Sep 17 00:00:00 2001
|
||||
From: Maks Verver <maks@verver.ch>
|
||||
Date: Tue, 8 Apr 2025 13:13:55 +0200
|
||||
Subject: [PATCH] [CVE-2025-32414] python: Read at most len/4 characters.
|
||||
|
||||
Fixes #889 by reserving space in the buffer for UTF-8 encoding of text.
|
||||
|
||||
CVE: CVE-2025-32414
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/d7657811964eac1cb9743bb98649278ad948f0d2]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
python/libxml.c | 28 ++++++++++++++++++----------
|
||||
1 file changed, 18 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/python/libxml.c b/python/libxml.c
|
||||
index 1fe8d685..2bf14078 100644
|
||||
--- a/python/libxml.c
|
||||
+++ b/python/libxml.c
|
||||
@@ -248,7 +248,9 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
|
||||
|
||||
file = (PyObject *) context;
|
||||
if (file == NULL) return(-1);
|
||||
- ret = PyObject_CallMethod(file, (char *) "read", (char *) "(i)", len);
|
||||
+ /* When read() returns a string, the length is in characters not bytes, so
|
||||
+ request at most len / 4 characters to leave space for UTF-8 encoding. */
|
||||
+ ret = PyObject_CallMethod(file, (char *) "read", (char *) "(i)", len / 4);
|
||||
if (ret == NULL) {
|
||||
printf("xmlPythonFileReadRaw: result is NULL\n");
|
||||
return(-1);
|
||||
@@ -283,10 +285,12 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
|
||||
Py_DECREF(ret);
|
||||
return(-1);
|
||||
}
|
||||
- if (lenread > len)
|
||||
- memcpy(buffer, data, len);
|
||||
- else
|
||||
- memcpy(buffer, data, lenread);
|
||||
+ if (lenread < 0 || lenread > len) {
|
||||
+ printf("xmlPythonFileReadRaw: invalid lenread\n");
|
||||
+ Py_DECREF(ret);
|
||||
+ return(-1);
|
||||
+ }
|
||||
+ memcpy(buffer, data, lenread);
|
||||
Py_DECREF(ret);
|
||||
return(lenread);
|
||||
}
|
||||
@@ -310,7 +314,9 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
|
||||
|
||||
file = (PyObject *) context;
|
||||
if (file == NULL) return(-1);
|
||||
- ret = PyObject_CallMethod(file, (char *) "io_read", (char *) "(i)", len);
|
||||
+ /* When io_read() returns a string, the length is in characters not bytes, so
|
||||
+ request at most len / 4 characters to leave space for UTF-8 encoding. */
|
||||
+ ret = PyObject_CallMethod(file, (char *) "io_read", (char *) "(i)", len / 4);
|
||||
if (ret == NULL) {
|
||||
printf("xmlPythonFileRead: result is NULL\n");
|
||||
return(-1);
|
||||
@@ -345,10 +351,12 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
|
||||
Py_DECREF(ret);
|
||||
return(-1);
|
||||
}
|
||||
- if (lenread > len)
|
||||
- memcpy(buffer, data, len);
|
||||
- else
|
||||
- memcpy(buffer, data, lenread);
|
||||
+ if (lenread < 0 || lenread > len) {
|
||||
+ printf("xmlPythonFileRead: invalid lenread\n");
|
||||
+ Py_DECREF(ret);
|
||||
+ return(-1);
|
||||
+ }
|
||||
+ memcpy(buffer, data, lenread);
|
||||
Py_DECREF(ret);
|
||||
return(lenread);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
From 384cc7c182fc00c6d5e2ab4b5e3671b2e3f93c84 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Sun, 6 Apr 2025 12:41:11 +0200
|
||||
Subject: [PATCH] [CVE-2025-32415] schemas: Fix heap buffer overflow in
|
||||
xmlSchemaIDCFillNodeTables
|
||||
|
||||
Don't use local variable which could contain a stale value.
|
||||
|
||||
Fixes #890.
|
||||
|
||||
CVE: CVE-2025-32415
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/384cc7c182fc00c6d5e2ab4b5e3671b2e3f93c84]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
xmlschemas.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xmlschemas.c b/xmlschemas.c
|
||||
index 28b14bd4..428e3c82 100644
|
||||
--- a/xmlschemas.c
|
||||
+++ b/xmlschemas.c
|
||||
@@ -23324,7 +23324,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
|
||||
j++;
|
||||
} while (j < nbDupls);
|
||||
}
|
||||
- if (nbNodeTable) {
|
||||
+ if (bind->nbNodes) {
|
||||
j = 0;
|
||||
do {
|
||||
if (nbFields == 1) {
|
||||
@@ -23375,7 +23375,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
|
||||
|
||||
next_node_table_entry:
|
||||
j++;
|
||||
- } while (j < nbNodeTable);
|
||||
+ } while (j < bind->nbNodes);
|
||||
}
|
||||
/*
|
||||
* If everything is fine, then add the IDC target-node to
|
||||
@@ -0,0 +1,186 @@
|
||||
From 71e1e8af5ee46dad1b57bb96cfbf1c3ad21fbd7b Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Fri, 4 Jul 2025 14:28:26 +0200
|
||||
Subject: [PATCH] schematron: Fix memory safety issues in
|
||||
xmlSchematronReportOutput
|
||||
|
||||
Fix use-after-free (CVE-2025-49794) and type confusion (CVE-2025-49796)
|
||||
in xmlSchematronReportOutput.
|
||||
|
||||
Fixes #931.
|
||||
Fixes #933.
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/71e1e8af5ee46dad1b57bb96cfbf1c3ad21fbd7b]
|
||||
CVE: CVE-2025-49794 CVE-2025-49796
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
result/schematron/cve-2025-49794_0.err | 2 ++
|
||||
result/schematron/cve-2025-49796_0.err | 2 ++
|
||||
schematron.c | 49 ++++++++++++++------------
|
||||
test/schematron/cve-2025-49794.sct | 10 ++++++
|
||||
test/schematron/cve-2025-49794_0.xml | 6 ++++
|
||||
test/schematron/cve-2025-49796.sct | 9 +++++
|
||||
test/schematron/cve-2025-49796_0.xml | 3 ++
|
||||
7 files changed, 58 insertions(+), 23 deletions(-)
|
||||
create mode 100644 result/schematron/cve-2025-49794_0.err
|
||||
create mode 100644 result/schematron/cve-2025-49796_0.err
|
||||
create mode 100644 test/schematron/cve-2025-49794.sct
|
||||
create mode 100644 test/schematron/cve-2025-49794_0.xml
|
||||
create mode 100644 test/schematron/cve-2025-49796.sct
|
||||
create mode 100644 test/schematron/cve-2025-49796_0.xml
|
||||
|
||||
diff --git a/result/schematron/cve-2025-49794_0.err b/result/schematron/cve-2025-49794_0.err
|
||||
new file mode 100644
|
||||
index 0000000..5775231
|
||||
--- /dev/null
|
||||
+++ b/result/schematron/cve-2025-49794_0.err
|
||||
@@ -0,0 +1,2 @@
|
||||
+./test/schematron/cve-2025-49794_0.xml:2: element boo0: schematron error : /librar0/boo0 line 2:
|
||||
+./test/schematron/cve-2025-49794_0.xml fails to validate
|
||||
diff --git a/result/schematron/cve-2025-49796_0.err b/result/schematron/cve-2025-49796_0.err
|
||||
new file mode 100644
|
||||
index 0000000..bf875ee
|
||||
--- /dev/null
|
||||
+++ b/result/schematron/cve-2025-49796_0.err
|
||||
@@ -0,0 +1,2 @@
|
||||
+./test/schematron/cve-2025-49796_0.xml:2: element boo0: schematron error : /librar0/boo0 line 2:
|
||||
+./test/schematron/cve-2025-49796_0.xml fails to validate
|
||||
diff --git a/schematron.c b/schematron.c
|
||||
index a825920..411a515 100644
|
||||
--- a/schematron.c
|
||||
+++ b/schematron.c
|
||||
@@ -1389,27 +1389,15 @@ exit:
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
-static xmlNodePtr
|
||||
+static xmlXPathObjectPtr
|
||||
xmlSchematronGetNode(xmlSchematronValidCtxtPtr ctxt,
|
||||
xmlNodePtr cur, const xmlChar *xpath) {
|
||||
- xmlNodePtr node = NULL;
|
||||
- xmlXPathObjectPtr ret;
|
||||
-
|
||||
if ((ctxt == NULL) || (cur == NULL) || (xpath == NULL))
|
||||
return(NULL);
|
||||
|
||||
ctxt->xctxt->doc = cur->doc;
|
||||
ctxt->xctxt->node = cur;
|
||||
- ret = xmlXPathEval(xpath, ctxt->xctxt);
|
||||
- if (ret == NULL)
|
||||
- return(NULL);
|
||||
-
|
||||
- if ((ret->type == XPATH_NODESET) &&
|
||||
- (ret->nodesetval != NULL) && (ret->nodesetval->nodeNr > 0))
|
||||
- node = ret->nodesetval->nodeTab[0];
|
||||
-
|
||||
- xmlXPathFreeObject(ret);
|
||||
- return(node);
|
||||
+ return(xmlXPathEval(xpath, ctxt->xctxt));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1455,25 +1443,40 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
|
||||
(child->type == XML_CDATA_SECTION_NODE))
|
||||
ret = xmlStrcat(ret, child->content);
|
||||
else if (IS_SCHEMATRON(child, "name")) {
|
||||
+ xmlXPathObject *obj = NULL;
|
||||
xmlChar *path;
|
||||
|
||||
path = xmlGetNoNsProp(child, BAD_CAST "path");
|
||||
|
||||
node = cur;
|
||||
if (path != NULL) {
|
||||
- node = xmlSchematronGetNode(ctxt, cur, path);
|
||||
- if (node == NULL)
|
||||
- node = cur;
|
||||
+ obj = xmlSchematronGetNode(ctxt, cur, path);
|
||||
+ if ((obj != NULL) &&
|
||||
+ (obj->type == XPATH_NODESET) &&
|
||||
+ (obj->nodesetval != NULL) &&
|
||||
+ (obj->nodesetval->nodeNr > 0))
|
||||
+ node = obj->nodesetval->nodeTab[0];
|
||||
xmlFree(path);
|
||||
}
|
||||
|
||||
- if ((node->ns == NULL) || (node->ns->prefix == NULL))
|
||||
- ret = xmlStrcat(ret, node->name);
|
||||
- else {
|
||||
- ret = xmlStrcat(ret, node->ns->prefix);
|
||||
- ret = xmlStrcat(ret, BAD_CAST ":");
|
||||
- ret = xmlStrcat(ret, node->name);
|
||||
+ switch (node->type) {
|
||||
+ case XML_ELEMENT_NODE:
|
||||
+ case XML_ATTRIBUTE_NODE:
|
||||
+ if ((node->ns == NULL) || (node->ns->prefix == NULL))
|
||||
+ ret = xmlStrcat(ret, node->name);
|
||||
+ else {
|
||||
+ ret = xmlStrcat(ret, node->ns->prefix);
|
||||
+ ret = xmlStrcat(ret, BAD_CAST ":");
|
||||
+ ret = xmlStrcat(ret, node->name);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ /* TODO: handle other node types */
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
+
|
||||
+ xmlXPathFreeObject(obj);
|
||||
} else if (IS_SCHEMATRON(child, "value-of")) {
|
||||
xmlChar *select;
|
||||
xmlXPathObjectPtr eval;
|
||||
diff --git a/test/schematron/cve-2025-49794.sct b/test/schematron/cve-2025-49794.sct
|
||||
new file mode 100644
|
||||
index 0000000..7fc9ee3
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/cve-2025-49794.sct
|
||||
@@ -0,0 +1,10 @@
|
||||
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
|
||||
+ <sch:pattern id="">
|
||||
+ <sch:rule context="boo0">
|
||||
+ <sch:report test="not(0)">
|
||||
+ <sch:name path="	e|namespace::*|e"/>
|
||||
+ </sch:report>
|
||||
+ <sch:report test="0"></sch:report>
|
||||
+ </sch:rule>
|
||||
+ </sch:pattern>
|
||||
+</sch:schema>
|
||||
diff --git a/test/schematron/cve-2025-49794_0.xml b/test/schematron/cve-2025-49794_0.xml
|
||||
new file mode 100644
|
||||
index 0000000..debc64b
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/cve-2025-49794_0.xml
|
||||
@@ -0,0 +1,6 @@
|
||||
+<librar0>
|
||||
+ <boo0 t="">
|
||||
+ <author></author>
|
||||
+ </boo0>
|
||||
+ <ins></ins>
|
||||
+</librar0>
|
||||
diff --git a/test/schematron/cve-2025-49796.sct b/test/schematron/cve-2025-49796.sct
|
||||
new file mode 100644
|
||||
index 0000000..e9702d7
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/cve-2025-49796.sct
|
||||
@@ -0,0 +1,9 @@
|
||||
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
|
||||
+ <sch:pattern id="">
|
||||
+ <sch:rule context="boo0">
|
||||
+ <sch:report test="not(0)">
|
||||
+ <sch:name path="/"/>
|
||||
+ </sch:report>
|
||||
+ </sch:rule>
|
||||
+ </sch:pattern>
|
||||
+</sch:schema>
|
||||
diff --git a/test/schematron/cve-2025-49796_0.xml b/test/schematron/cve-2025-49796_0.xml
|
||||
new file mode 100644
|
||||
index 0000000..be33c4e
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/cve-2025-49796_0.xml
|
||||
@@ -0,0 +1,3 @@
|
||||
+<librar0>
|
||||
+ <boo0/>
|
||||
+</librar0>
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
From 19e0a3ed092085a4d6689397d4f08cf5d86267af Mon Sep 17 00:00:00 2001
|
||||
From: Michael Mann <mmann78@netscape.net>
|
||||
Date: Sat, 21 Jun 2025 12:11:30 -0400
|
||||
Subject: [PATCH] Schematron: Fix null pointer dereference leading to DoS
|
||||
|
||||
(CVE-2025-49795)
|
||||
|
||||
Fixes #932
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/c24909ba2601848825b49a60f988222da3019667]
|
||||
CVE: CVE-2025-49795
|
||||
|
||||
(cherry picked from commit c24909ba2601848825b49a60f988222da3019667)
|
||||
Signed-off-by: Roland Kovacs <roland.kovacs@est.tech>
|
||||
---
|
||||
result/schematron/zvon16_0 | 6 ++++++
|
||||
result/schematron/zvon16_0.err | 5 +++++
|
||||
schematron.c | 5 +++++
|
||||
test/schematron/zvon16.sct | 7 +++++++
|
||||
test/schematron/zvon16_0.xml | 5 +++++
|
||||
5 files changed, 28 insertions(+)
|
||||
create mode 100644 result/schematron/zvon16_0
|
||||
create mode 100644 result/schematron/zvon16_0.err
|
||||
create mode 100644 test/schematron/zvon16.sct
|
||||
create mode 100644 test/schematron/zvon16_0.xml
|
||||
|
||||
diff --git a/result/schematron/zvon16_0 b/result/schematron/zvon16_0
|
||||
new file mode 100644
|
||||
index 00000000..768cf6f5
|
||||
--- /dev/null
|
||||
+++ b/result/schematron/zvon16_0
|
||||
@@ -0,0 +1,6 @@
|
||||
+<?xml version="1.0"?>
|
||||
+<library>
|
||||
+ <book title="Test Book" id="bk101">
|
||||
+ <author>Test Author</author>
|
||||
+ </book>
|
||||
+</library>
|
||||
diff --git a/result/schematron/zvon16_0.err b/result/schematron/zvon16_0.err
|
||||
new file mode 100644
|
||||
index 00000000..a4fab4c8
|
||||
--- /dev/null
|
||||
+++ b/result/schematron/zvon16_0.err
|
||||
@@ -0,0 +1,5 @@
|
||||
+Pattern: TestPattern
|
||||
+xmlXPathCompOpEval: function falae not found
|
||||
+XPath error : Unregistered function
|
||||
+/library/book line 2: Book
|
||||
+./test/schematron/zvon16_0.xml fails to validate
|
||||
diff --git a/schematron.c b/schematron.c
|
||||
index a8259201..86c63e64 100644
|
||||
--- a/schematron.c
|
||||
+++ b/schematron.c
|
||||
@@ -1481,6 +1481,11 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
|
||||
select = xmlGetNoNsProp(child, BAD_CAST "select");
|
||||
comp = xmlXPathCtxtCompile(ctxt->xctxt, select);
|
||||
eval = xmlXPathCompiledEval(comp, ctxt->xctxt);
|
||||
+ if (eval == NULL) {
|
||||
+ xmlXPathFreeCompExpr(comp);
|
||||
+ xmlFree(select);
|
||||
+ return ret;
|
||||
+ }
|
||||
|
||||
switch (eval->type) {
|
||||
case XPATH_NODESET: {
|
||||
diff --git a/test/schematron/zvon16.sct b/test/schematron/zvon16.sct
|
||||
new file mode 100644
|
||||
index 00000000..f03848aa
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/zvon16.sct
|
||||
@@ -0,0 +1,7 @@
|
||||
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
|
||||
+ <sch:pattern id="TestPattern">
|
||||
+ <sch:rule context="book">
|
||||
+ <sch:report test="not(@available)">Book <sch:value-of select="falae()"/> test</sch:report>
|
||||
+ </sch:rule>
|
||||
+ </sch:pattern>
|
||||
+</sch:schema>
|
||||
diff --git a/test/schematron/zvon16_0.xml b/test/schematron/zvon16_0.xml
|
||||
new file mode 100644
|
||||
index 00000000..551e2d65
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/zvon16_0.xml
|
||||
@@ -0,0 +1,5 @@
|
||||
+<library>
|
||||
+ <book title="Test Book" id="bk101">
|
||||
+ <author>Test Author</author>
|
||||
+ </book>
|
||||
+</library>
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Tue, 27 May 2025 12:53:17 +0200
|
||||
Subject: [PATCH] tree: Fix integer overflow in xmlBuildQName
|
||||
|
||||
This issue affects memory safety.
|
||||
|
||||
Fixes #926.
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0]
|
||||
CVE: CVE-2025-6021
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
tree.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tree.c b/tree.c
|
||||
index dc3ac4f..f89e3cd 100644
|
||||
--- a/tree.c
|
||||
+++ b/tree.c
|
||||
@@ -47,6 +47,10 @@
|
||||
#include "private/error.h"
|
||||
#include "private/tree.h"
|
||||
|
||||
+#ifndef SIZE_MAX
|
||||
+#define SIZE_MAX ((size_t) -1)
|
||||
+#endif
|
||||
+
|
||||
int __xmlRegisterCallbacks = 0;
|
||||
|
||||
/************************************************************************
|
||||
@@ -216,16 +220,18 @@ xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
|
||||
xmlChar *
|
||||
xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix,
|
||||
xmlChar *memory, int len) {
|
||||
- int lenn, lenp;
|
||||
+ size_t lenn, lenp;
|
||||
xmlChar *ret;
|
||||
|
||||
- if (ncname == NULL) return(NULL);
|
||||
+ if ((ncname == NULL) || (len < 0)) return(NULL);
|
||||
if (prefix == NULL) return((xmlChar *) ncname);
|
||||
|
||||
lenn = strlen((char *) ncname);
|
||||
lenp = strlen((char *) prefix);
|
||||
+ if (lenn >= SIZE_MAX - lenp - 1)
|
||||
+ return(NULL);
|
||||
|
||||
- if ((memory == NULL) || (len < lenn + lenp + 2)) {
|
||||
+ if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
|
||||
ret = (xmlChar *) xmlMallocAtomic(lenn + lenp + 2);
|
||||
if (ret == NULL) {
|
||||
xmlTreeErrMemory("building QName");
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
From 5e9ec5c107d3f5b5179c3dbc19df43df041cd55b Mon Sep 17 00:00:00 2001
|
||||
From: Michael Mann <mmann78@netscape.net>
|
||||
Date: Fri, 20 Jun 2025 23:05:00 -0400
|
||||
Subject: [PATCH] [CVE-2025-6170] Fix potential buffer overflows of interactive
|
||||
shell
|
||||
|
||||
Fixes #941
|
||||
|
||||
CVE: CVE-2025-6170
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/5e9ec5c107d3f5b5179c3dbc19df43df041cd55b]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
debugXML.c | 15 ++++++++++-----
|
||||
result/scripts/long_command | 8 ++++++++
|
||||
test/scripts/long_command.script | 6 ++++++
|
||||
test/scripts/long_command.xml | 1 +
|
||||
4 files changed, 25 insertions(+), 5 deletions(-)
|
||||
create mode 100644 result/scripts/long_command
|
||||
create mode 100644 test/scripts/long_command.script
|
||||
create mode 100644 test/scripts/long_command.xml
|
||||
|
||||
diff --git a/debugXML.c b/debugXML.c
|
||||
index ed56b0f8..452b9573 100644
|
||||
--- a/debugXML.c
|
||||
+++ b/debugXML.c
|
||||
@@ -1043,6 +1043,10 @@ xmlCtxtDumpOneNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
|
||||
xmlCtxtGenericNodeCheck(ctxt, node);
|
||||
}
|
||||
|
||||
+#define MAX_PROMPT_SIZE 500
|
||||
+#define MAX_ARG_SIZE 400
|
||||
+#define MAX_COMMAND_SIZE 100
|
||||
+
|
||||
/**
|
||||
* xmlCtxtDumpNode:
|
||||
* @output: the FILE * for the output
|
||||
@@ -2794,10 +2798,10 @@ void
|
||||
xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
FILE * output)
|
||||
{
|
||||
- char prompt[500] = "/ > ";
|
||||
+ char prompt[MAX_PROMPT_SIZE] = "/ > ";
|
||||
char *cmdline = NULL, *cur;
|
||||
- char command[100];
|
||||
- char arg[400];
|
||||
+ char command[MAX_COMMAND_SIZE];
|
||||
+ char arg[MAX_ARG_SIZE];
|
||||
int i;
|
||||
xmlShellCtxtPtr ctxt;
|
||||
xmlXPathObjectPtr list;
|
||||
@@ -2855,7 +2859,8 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
cur++;
|
||||
i = 0;
|
||||
while ((*cur != ' ') && (*cur != '\t') &&
|
||||
- (*cur != '\n') && (*cur != '\r')) {
|
||||
+ (*cur != '\n') && (*cur != '\r') &&
|
||||
+ (i < (MAX_COMMAND_SIZE - 1))) {
|
||||
if (*cur == 0)
|
||||
break;
|
||||
command[i++] = *cur++;
|
||||
@@ -2870,7 +2875,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
while ((*cur == ' ') || (*cur == '\t'))
|
||||
cur++;
|
||||
i = 0;
|
||||
- while ((*cur != '\n') && (*cur != '\r') && (*cur != 0)) {
|
||||
+ while ((*cur != '\n') && (*cur != '\r') && (*cur != 0) && (i < (MAX_ARG_SIZE-1))) {
|
||||
if (*cur == 0)
|
||||
break;
|
||||
arg[i++] = *cur++;
|
||||
diff --git a/result/scripts/long_command b/result/scripts/long_command
|
||||
new file mode 100644
|
||||
index 00000000..e6f00708
|
||||
--- /dev/null
|
||||
+++ b/result/scripts/long_command
|
||||
@@ -0,0 +1,8 @@
|
||||
+/ > b > b > Object is a Node Set :
|
||||
+Set contains 1 nodes:
|
||||
+1 ELEMENT a:c
|
||||
+b > Unknown command This_is_a_really_long_command_string_designed_to_test_the_limits_of_the_memory_that_stores_the_comm
|
||||
+b > b > Unknown command ess_currents_of_time_and_existence
|
||||
+b > <?xml version="1.0"?>
|
||||
+<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>
|
||||
+b >
|
||||
\ No newline at end of file
|
||||
diff --git a/test/scripts/long_command.script b/test/scripts/long_command.script
|
||||
new file mode 100644
|
||||
index 00000000..00f6df09
|
||||
--- /dev/null
|
||||
+++ b/test/scripts/long_command.script
|
||||
@@ -0,0 +1,6 @@
|
||||
+cd a/b
|
||||
+set <a:c/>
|
||||
+xpath //*[namespace-uri()="foo"]
|
||||
+This_is_a_really_long_command_string_designed_to_test_the_limits_of_the_memory_that_stores_the_command_please_dont_crash foo
|
||||
+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
|
||||
+save -
|
||||
diff --git a/test/scripts/long_command.xml b/test/scripts/long_command.xml
|
||||
new file mode 100644
|
||||
index 00000000..1ba44016
|
||||
--- /dev/null
|
||||
+++ b/test/scripts/long_command.xml
|
||||
@@ -0,0 +1 @@
|
||||
+<a xmlns:a="bar"><b xmlns:a="foo"/></a>
|
||||
@@ -0,0 +1,34 @@
|
||||
From 0779511838a8cbd1e0f431c22f28f286a2a37b1b Mon Sep 17 00:00:00 2001
|
||||
From: Ross Burton <ross.burton@arm.com>
|
||||
Date: Mon, 5 Dec 2022 17:02:32 +0000
|
||||
Subject: [PATCH] add yocto-specific install-ptest target
|
||||
|
||||
Add a target to install the test suite.
|
||||
|
||||
Upstream-Status: Inappropriate
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
---
|
||||
Makefile.am | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 0a49d37..1097c63 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -27,6 +27,16 @@ check_PROGRAMS = \
|
||||
testparser \
|
||||
testrecurse
|
||||
|
||||
+ptestdir=$(libexecdir)
|
||||
+install-test-data: $(check_PROGRAMS)
|
||||
+ install -d $(DESTDIR)$(ptestdir) $(DESTDIR)$(ptestdir)/python/
|
||||
+ for T in $(check_PROGRAMS); do \
|
||||
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$T $(DESTDIR)$(ptestdir) ;\
|
||||
+ done
|
||||
+ cp -r $(srcdir)/test $(DESTDIR)$(ptestdir)
|
||||
+ cp -r $(srcdir)/result $(DESTDIR)$(ptestdir)
|
||||
+ cp -r $(srcdir)/python/tests $(DESTDIR)$(ptestdir)/python
|
||||
+
|
||||
bin_PROGRAMS = xmllint xmlcatalog
|
||||
|
||||
bin_SCRIPTS = xml2-config
|
||||
20
sources/poky/meta/recipes-core/libxml/libxml2/run-ptest
Executable file
20
sources/poky/meta/recipes-core/libxml/libxml2/run-ptest
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
export LC_ALL=en_US.UTF-8
|
||||
|
||||
# testModule isn't that useful and hard-codes buildtree, so we don't run that
|
||||
TESTS="runtest runsuite testrecurse testchar testdict testThreads runxmlconf testapi"
|
||||
|
||||
for T in $TESTS; do
|
||||
echo Running $T
|
||||
./$T && echo PASS: $T || echo FAIL: $T
|
||||
done
|
||||
|
||||
if test -d python/tests; then
|
||||
cd python/tests
|
||||
for T in *.py; do
|
||||
python3 ./$T && echo PASS: $T || echo FAIL: $T
|
||||
done
|
||||
fi
|
||||
107
sources/poky/meta/recipes-core/libxml/libxml2_2.12.10.bb
Normal file
107
sources/poky/meta/recipes-core/libxml/libxml2_2.12.10.bb
Normal file
@@ -0,0 +1,107 @@
|
||||
SUMMARY = "XML C Parser Library and Toolkit"
|
||||
DESCRIPTION = "The XML Parser Library allows for manipulation of XML files. Libxml2 exports Push and Pull type parser interfaces for both XML and HTML. It can do DTD validation at parse time, on a parsed document instance or with an arbitrary DTD. Libxml2 includes complete XPath, XPointer and Xinclude implementations. It also has a SAX like interface, which is designed to be compatible with Expat."
|
||||
HOMEPAGE = "https://gitlab.gnome.org/GNOME/libxml2"
|
||||
BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2"
|
||||
SECTION = "libs"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://Copyright;md5=fec7ecfe714722b2bb0aaff7d200c701 \
|
||||
file://dict.c;beginline=6;endline=15;md5=2b4b7b827d2d8b080372433c4c9c85b6 \
|
||||
file://list.c;beginline=4;endline=13;md5=b9c25b021ccaf287e50060602d20f3a7 \
|
||||
file://trio.c;beginline=5;endline=14;md5=cd4f61e27f88c1d43df112966b1cd28f \
|
||||
"
|
||||
|
||||
DEPENDS = "zlib virtual/libiconv"
|
||||
|
||||
GNOMEBASEBUILDCLASS = "autotools"
|
||||
inherit gnomebase
|
||||
|
||||
SRC_URI += "http://www.w3.org/XML/Test/xmlts20130923.tar;subdir=${BP};name=testtar \
|
||||
file://run-ptest \
|
||||
file://install-tests.patch \
|
||||
file://CVE-2025-32414.patch \
|
||||
file://CVE-2025-32415.patch \
|
||||
file://CVE-2025-6021.patch \
|
||||
file://CVE-2025-49794-CVE-2025-49796.patch \
|
||||
file://CVE-2025-49795.patch \
|
||||
file://CVE-2025-6170.patch \
|
||||
"
|
||||
|
||||
SRC_URI[archive.sha256sum] = "c3d8c0c34aa39098f66576fe51969db12a5100b956233dc56506f7a8679be995"
|
||||
SRC_URI[testtar.sha256sum] = "c6b2d42ee50b8b236e711a97d68e6c4b5c8d83e69a2be4722379f08702ea7273"
|
||||
|
||||
# Disputed as a security issue, but fixed in d39f780
|
||||
CVE_STATUS[CVE-2023-45322] = "disputed: issue requires memory allocation to fail"
|
||||
|
||||
BINCONFIG = "${bindir}/xml2-config"
|
||||
|
||||
PACKAGECONFIG ??= "python \
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
|
||||
"
|
||||
PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3"
|
||||
PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
|
||||
|
||||
inherit autotools pkgconfig binconfig-disabled ptest
|
||||
|
||||
inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
|
||||
|
||||
LDFLAGS:append:riscv64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', ' -fuse-ld=bfd', '', d)}"
|
||||
|
||||
RDEPENDS:${PN}-ptest += "bash make locale-base-en-us ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-logging python3-shell python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}"
|
||||
|
||||
RDEPENDS:${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
|
||||
|
||||
RDEPENDS:${PN}-ptest:append:libc-musl = " musl-locales"
|
||||
RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-gconv-ebcdic-us \
|
||||
glibc-gconv-ibm1141 \
|
||||
glibc-gconv-iso8859-5 \
|
||||
glibc-gconv-euc-jp \
|
||||
"
|
||||
|
||||
# WARNING: zlib is required for RPM use
|
||||
EXTRA_OECONF = "--without-debug --without-legacy --with-catalog --with-c14n --without-lzma --with-fexceptions"
|
||||
EXTRA_OECONF:class-native = "--without-legacy --with-c14n --without-lzma --with-zlib"
|
||||
EXTRA_OECONF:class-nativesdk = "--without-legacy --with-c14n --without-lzma --with-zlib"
|
||||
EXTRA_OECONF:linuxstdbase = "--with-debug --with-legacy --with-c14n --without-lzma --with-zlib"
|
||||
|
||||
python populate_packages:prepend () {
|
||||
# autonamer would call this libxml2-2, but we don't want that
|
||||
if d.getVar('DEBIAN_NAMES'):
|
||||
d.setVar('PKG:libxml2', '${MLPREFIX}libxml2')
|
||||
}
|
||||
|
||||
PACKAGE_BEFORE_PN += "${PN}-utils"
|
||||
PACKAGES += "${PN}-python"
|
||||
|
||||
FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
|
||||
FILES:${PN}-utils = "${bindir}/*"
|
||||
FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
|
||||
|
||||
do_configure:prepend () {
|
||||
# executables take longer to package: these should not be executable
|
||||
find ${S}/xmlconf/ -type f -exec chmod -x {} \+
|
||||
}
|
||||
|
||||
do_install_ptest () {
|
||||
oe_runmake DESTDIR=${D} ptestdir=${PTEST_PATH} install-test-data
|
||||
|
||||
cp -r ${S}/xmlconf ${D}${PTEST_PATH}
|
||||
|
||||
if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
|
||||
rm -rf ${D}${PTEST_DIR}/python
|
||||
fi
|
||||
}
|
||||
|
||||
# with musl we need to enable icu support explicitly for these tests
|
||||
do_install_ptest:append:libc-musl () {
|
||||
rm -rf ${D}/${PTEST_PATH}/test/icu_parse_test.xml
|
||||
}
|
||||
|
||||
do_install:append:class-native () {
|
||||
# Docs are not needed in the native case
|
||||
rm ${D}${datadir}/gtk-doc -rf
|
||||
|
||||
create_wrapper ${D}${bindir}/xmllint 'XML_CATALOG_FILES=${XML_CATALOG_FILES:-${sysconfdir}/xml/catalog}'
|
||||
}
|
||||
do_install[vardepsexclude] += "XML_CATALOG_FILES:-${sysconfdir}/xml/catalog"
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
Reference in New Issue
Block a user