summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/libxml/libxml2
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/libxml/libxml2')
-rw-r--r--meta/recipes-core/libxml/libxml2/0001-Revert-cmake-Fix-installation-directories-in-libxml2.patch81
-rw-r--r--meta/recipes-core/libxml/libxml2/CVE-2025-6021.patch59
-rw-r--r--meta/recipes-core/libxml/libxml2/install-tests.patch8
-rwxr-xr-xmeta/recipes-core/libxml/libxml2/run-ptest2
4 files changed, 145 insertions, 5 deletions
diff --git a/meta/recipes-core/libxml/libxml2/0001-Revert-cmake-Fix-installation-directories-in-libxml2.patch b/meta/recipes-core/libxml/libxml2/0001-Revert-cmake-Fix-installation-directories-in-libxml2.patch
new file mode 100644
index 0000000000..6ea5adafa2
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/0001-Revert-cmake-Fix-installation-directories-in-libxml2.patch
@@ -0,0 +1,81 @@
1From 55ed199fdb55a1a600616ba14ad0feedcf828d86 Mon Sep 17 00:00:00 2001
2From: Peter Marko <peter.marko@siemens.com>
3Date: Mon, 26 May 2025 21:11:14 +0200
4Subject: [PATCH] Revert "cmake: Fix installation directories in
5 libxml2-config.cmake"
6
7This reverts commit 75dde50b20215a2a3a445b62f36a67c8ed337cab.
8
9Upstream-Status: Inappropriate [upstream ticket https://gitlab.gnome.org/GNOME/libxml2/-/issues/898#note_2452864]
10Signed-off-by: Peter Marko <peter.marko@siemens.com>
11---
12 configure.ac | 11 -----------
13 libxml2-config.cmake.in | 11 +++++++----
14 meson.build | 3 ---
15 3 files changed, 7 insertions(+), 18 deletions(-)
16
17diff --git a/configure.ac b/configure.ac
18index 40e75151..d21ebfe5 100644
19--- a/configure.ac
20+++ b/configure.ac
21@@ -1061,17 +1061,6 @@ AC_SUBST(XML_PRIVATE_LIBS)
22 AC_SUBST(XML_PRIVATE_CFLAGS)
23 AC_SUBST(XML_INCLUDEDIR)
24
25-# for libxml2-config.cmake.in
26-AX_RECURSIVE_EVAL(["$bindir"], [INSTALL_BINDIR])
27-AX_RECURSIVE_EVAL(["$includedir"], [INSTALL_INCLUDEDIR])
28-AX_RECURSIVE_EVAL(["$libdir"], [INSTALL_LIBDIR])
29-AC_SUBST(INSTALL_BINDIR)
30-AC_SUBST(INSTALL_INCLUDEDIR)
31-AC_SUBST(INSTALL_LIBDIR)
32-AM_SUBST_NOTMAKE(INSTALL_BINDIR)
33-AM_SUBST_NOTMAKE(INSTALL_INCLUDEDIR)
34-AM_SUBST_NOTMAKE(INSTALL_LIBDIR)
35-
36 AX_RECURSIVE_EVAL(["$sysconfdir"], [XML_SYSCONFDIR])
37 AC_DEFINE_UNQUOTED([XML_SYSCONFDIR], ["$XML_SYSCONFDIR"],
38 [System configuration directory (/etc)])
39diff --git a/libxml2-config.cmake.in b/libxml2-config.cmake.in
40index 4945dda4..31036805 100644
41--- a/libxml2-config.cmake.in
42+++ b/libxml2-config.cmake.in
43@@ -24,17 +24,20 @@
44 # LibXml2::LibXml2 - the LibXml2 library
45 # LibXml2::xmllint - the xmllint command-line executable
46
47+get_filename_component(_libxml2_rootdir ${CMAKE_CURRENT_LIST_DIR}/../../../ ABSOLUTE)
48+
49 set(LIBXML2_VERSION_MAJOR @LIBXML_MAJOR_VERSION@)
50 set(LIBXML2_VERSION_MINOR @LIBXML_MINOR_VERSION@)
51 set(LIBXML2_VERSION_MICRO @LIBXML_MICRO_VERSION@)
52 set(LIBXML2_VERSION_STRING "@VERSION@")
53 set(LIBXML2_DEFINITIONS "@XML_CFLAGS@")
54-set(LIBXML2_INCLUDE_DIR @INSTALL_INCLUDEDIR@/libxml2)
55-set(LIBXML2_LIBRARY_DIR @INSTALL_LIBDIR@)
56+set(LIBXML2_INSTALL_PREFIX ${_libxml2_rootdir})
57+set(LIBXML2_INCLUDE_DIR ${_libxml2_rootdir}/include/libxml2)
58+set(LIBXML2_LIBRARY_DIR ${_libxml2_rootdir}/lib)
59
60 find_library(LIBXML2_LIBRARY NAMES xml2 HINTS ${LIBXML2_LIBRARY_DIR} NO_DEFAULT_PATH)
61-find_program(LIBXML2_XMLCATALOG_EXECUTABLE NAMES xmlcatalog HINTS @INSTALL_BINDIR@ NO_DEFAULT_PATH)
62-find_program(LIBXML2_XMLLINT_EXECUTABLE NAMES xmllint HINTS @INSTALL_BINDIR@ NO_DEFAULT_PATH)
63+find_program(LIBXML2_XMLCATALOG_EXECUTABLE NAMES xmlcatalog HINTS ${_libxml2_rootdir}/bin NO_DEFAULT_PATH)
64+find_program(LIBXML2_XMLLINT_EXECUTABLE NAMES xmllint HINTS ${_libxml2_rootdir}/bin NO_DEFAULT_PATH)
65
66 set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
67 set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
68diff --git a/meson.build b/meson.build
69index 4c59211d..3e5f25d3 100644
70--- a/meson.build
71+++ b/meson.build
72@@ -599,9 +599,6 @@ config_cmake = configuration_data()
73 config_cmake.set('LIBXML_MAJOR_VERSION', v_maj)
74 config_cmake.set('LIBXML_MINOR_VERSION', v_min)
75 config_cmake.set('LIBXML_MICRO_VERSION', v_mic)
76-config_cmake.set('INSTALL_BINDIR', dir_bin)
77-config_cmake.set('INSTALL_INCLUDEDIR', dir_include)
78-config_cmake.set('INSTALL_LIBDIR', dir_lib)
79 config_cmake.set('VERSION', meson.project_version())
80 config_cmake.set('WITH_HTTP', want_http.to_int().to_string())
81 config_cmake.set('WITH_ICONV', want_iconv.to_int().to_string())
diff --git a/meta/recipes-core/libxml/libxml2/CVE-2025-6021.patch b/meta/recipes-core/libxml/libxml2/CVE-2025-6021.patch
new file mode 100644
index 0000000000..157486848b
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/CVE-2025-6021.patch
@@ -0,0 +1,59 @@
1From 33d7969baf541326a35e2fbe31943c46af8c71db Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Tue, 27 May 2025 12:53:17 +0200
4Subject: [PATCH] tree: Fix integer overflow in xmlBuildQName
5
6This issue affects memory safety and might receive a CVE ID later.
7
8Fixes #926.
9
10Signed-off-by: Nick Wellnhofer <wellnhofer@aevum.de>
11
12Add '#include <stdint.h>' to assure the definition of SIZE_MAX
13CVE: CVE-2025-6021
14Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0]
15Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
16---
17 tree.c | 9 ++++++---
18 1 file changed, 6 insertions(+), 3 deletions(-)
19
20diff --git a/tree.c b/tree.c
21index 7454b07..22ec11c 100644
22--- a/tree.c
23+++ b/tree.c
24@@ -23,6 +23,7 @@
25 #include <limits.h>
26 #include <ctype.h>
27 #include <stdlib.h>
28+#include <stdint.h>
29
30 #ifdef LIBXML_ZLIB_ENABLED
31 #include <zlib.h>
32@@ -168,10 +169,10 @@ xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
33 xmlChar *
34 xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix,
35 xmlChar *memory, int len) {
36- int lenn, lenp;
37+ size_t lenn, lenp;
38 xmlChar *ret;
39
40- if (ncname == NULL) return(NULL);
41+ if ((ncname == NULL) || (len < 0)) return(NULL);
42 if (prefix == NULL) return((xmlChar *) ncname);
43
44 #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
45@@ -182,8 +183,10 @@ xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix,
46
47 lenn = strlen((char *) ncname);
48 lenp = strlen((char *) prefix);
49+ if (lenn >= SIZE_MAX - lenp - 1)
50+ return(NULL);
51
52- if ((memory == NULL) || (len < lenn + lenp + 2)) {
53+ if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
54 ret = xmlMalloc(lenn + lenp + 2);
55 if (ret == NULL)
56 return(NULL);
57--
582.34.1
59
diff --git a/meta/recipes-core/libxml/libxml2/install-tests.patch b/meta/recipes-core/libxml/libxml2/install-tests.patch
index 478eeea81b..789aeca119 100644
--- a/meta/recipes-core/libxml/libxml2/install-tests.patch
+++ b/meta/recipes-core/libxml/libxml2/install-tests.patch
@@ -1,4 +1,4 @@
1From 0779511838a8cbd1e0f431c22f28f286a2a37b1b Mon Sep 17 00:00:00 2001 1From 8c1054eacb430472068f21e4840749c384e8e866 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com> 2From: Ross Burton <ross.burton@arm.com>
3Date: Mon, 5 Dec 2022 17:02:32 +0000 3Date: Mon, 5 Dec 2022 17:02:32 +0000
4Subject: [PATCH] add yocto-specific install-ptest target 4Subject: [PATCH] add yocto-specific install-ptest target
@@ -12,10 +12,10 @@ Signed-off-by: Ross Burton <ross.burton@arm.com>
12 1 file changed, 10 insertions(+) 12 1 file changed, 10 insertions(+)
13 13
14diff --git a/Makefile.am b/Makefile.am 14diff --git a/Makefile.am b/Makefile.am
15index 0a49d37..1097c63 100644 15index 4cb9a5c..8adcd7e 100644
16--- a/Makefile.am 16--- a/Makefile.am
17+++ b/Makefile.am 17+++ b/Makefile.am
18@@ -27,6 +27,16 @@ check_PROGRAMS = \ 18@@ -26,6 +26,16 @@ check_PROGRAMS = \
19 testparser \ 19 testparser \
20 testrecurse 20 testrecurse
21 21
@@ -29,6 +29,6 @@ index 0a49d37..1097c63 100644
29+ cp -r $(srcdir)/result $(DESTDIR)$(ptestdir) 29+ cp -r $(srcdir)/result $(DESTDIR)$(ptestdir)
30+ cp -r $(srcdir)/python/tests $(DESTDIR)$(ptestdir)/python 30+ cp -r $(srcdir)/python/tests $(DESTDIR)$(ptestdir)/python
31+ 31+
32 bin_PROGRAMS = xmllint xmlcatalog 32 bin_PROGRAMS = xmllint
33 33
34 bin_SCRIPTS = xml2-config 34 bin_SCRIPTS = xml2-config
diff --git a/meta/recipes-core/libxml/libxml2/run-ptest b/meta/recipes-core/libxml/libxml2/run-ptest
index f252a78f17..cbbdd5592f 100755
--- a/meta/recipes-core/libxml/libxml2/run-ptest
+++ b/meta/recipes-core/libxml/libxml2/run-ptest
@@ -5,7 +5,7 @@ set -e
5export LC_ALL=en_US.UTF-8 5export LC_ALL=en_US.UTF-8
6 6
7# testModule isn't that useful and hard-codes buildtree, so we don't run that 7# testModule isn't that useful and hard-codes buildtree, so we don't run that
8TESTS="runtest runsuite testrecurse testchar testdict testThreads runxmlconf testapi" 8TESTS="runtest runsuite testrecurse testchar testdict runxmlconf testapi testlimits testparser"
9 9
10for T in $TESTS; do 10for T in $TESTS; do
11 echo Running $T 11 echo Running $T