diff options
| author | Hitendra Prajapati <hprajapati@mvista.com> | 2025-07-04 14:16:21 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-07-14 08:37:40 -0700 |
| commit | 36c444aafc732a217254eca526b29221465eac52 (patch) | |
| tree | cf1188bb4cfa223dbe801dda85bbd2dbe9953f45 | |
| parent | bfcca9e2028f46c08416d78cbd5f9366e8305789 (diff) | |
| download | poky-36c444aafc732a217254eca526b29221465eac52.tar.gz | |
libxml2: fix CVE-2025-6021
Upstream-Status: Backport from https://gitlab.gnome.org/GNOME/libxml2/-/commit/acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0
(From OE-Core rev: f75ef5dc195490ef8223f9a16086243450141e61)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-core/libxml/libxml2/CVE-2025-6021.patch | 56 | ||||
| -rw-r--r-- | meta/recipes-core/libxml/libxml2_2.9.14.bb | 1 |
2 files changed, 57 insertions, 0 deletions
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..9ec58e33c2 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/CVE-2025-6021.patch | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | From acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Nick Wellnhofer <wellnhofer@aevum.de> | ||
| 3 | Date: Tue, 27 May 2025 12:53:17 +0200 | ||
| 4 | Subject: [PATCH] tree: Fix integer overflow in xmlBuildQName | ||
| 5 | |||
| 6 | This issue affects memory safety. | ||
| 7 | |||
| 8 | Fixes #926. | ||
| 9 | |||
| 10 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0] | ||
| 11 | CVE: CVE-2025-6021 | ||
| 12 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 13 | --- | ||
| 14 | tree.c | 12 +++++++++--- | ||
| 15 | 1 file changed, 9 insertions(+), 3 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/tree.c b/tree.c | ||
| 18 | index 6e04dfb..cdf863c 100644 | ||
| 19 | --- a/tree.c | ||
| 20 | +++ b/tree.c | ||
| 21 | @@ -50,6 +50,10 @@ | ||
| 22 | #include "buf.h" | ||
| 23 | #include "save.h" | ||
| 24 | |||
| 25 | +#ifndef SIZE_MAX | ||
| 26 | +#define SIZE_MAX ((size_t) -1) | ||
| 27 | +#endif | ||
| 28 | + | ||
| 29 | int __xmlRegisterCallbacks = 0; | ||
| 30 | |||
| 31 | /************************************************************************ | ||
| 32 | @@ -222,16 +226,18 @@ 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 | lenn = strlen((char *) ncname); | ||
| 45 | lenp = strlen((char *) prefix); | ||
| 46 | + if (lenn >= SIZE_MAX - lenp - 1) | ||
| 47 | + return(NULL); | ||
| 48 | |||
| 49 | - if ((memory == NULL) || (len < lenn + lenp + 2)) { | ||
| 50 | + if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) { | ||
| 51 | ret = (xmlChar *) xmlMallocAtomic(lenn + lenp + 2); | ||
| 52 | if (ret == NULL) { | ||
| 53 | xmlTreeErrMemory("building QName"); | ||
| 54 | -- | ||
| 55 | 2.49.0 | ||
| 56 | |||
diff --git a/meta/recipes-core/libxml/libxml2_2.9.14.bb b/meta/recipes-core/libxml/libxml2_2.9.14.bb index bd6dd88dee..45424e59ff 100644 --- a/meta/recipes-core/libxml/libxml2_2.9.14.bb +++ b/meta/recipes-core/libxml/libxml2_2.9.14.bb | |||
| @@ -39,6 +39,7 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar;subdir=${BP};name=testt | |||
| 39 | file://CVE-2025-24928.patch \ | 39 | file://CVE-2025-24928.patch \ |
| 40 | file://CVE-2025-32414.patch \ | 40 | file://CVE-2025-32414.patch \ |
| 41 | file://CVE-2025-32415.patch \ | 41 | file://CVE-2025-32415.patch \ |
| 42 | file://CVE-2025-6021.patch \ | ||
| 42 | " | 43 | " |
| 43 | 44 | ||
| 44 | SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" | 45 | SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" |
