diff options
| author | Vijay Anusuri <vanusuri@mvista.com> | 2025-10-06 14:57:35 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-10-14 07:20:35 -0700 |
| commit | 4ef41425c679eff0492d70d1ff8dfda52b582df1 (patch) | |
| tree | befba11060018e12be4dd4649afe06bb553664bc /meta | |
| parent | db50dd87bc7671dbf36d4390a737aec1c7747a31 (diff) | |
| download | poky-4ef41425c679eff0492d70d1ff8dfda52b582df1.tar.gz | |
libxslt: Patch for CVE-2025-7424
This patch is taken from the upstream bug, and is used by Apple in their
build of WebKit.
Origin: https://gitlab.gnome.org/-/project/1762/uploads/627ae84cb0643d9adf6e5c86947f6be6/gnome-libxslt-bug-139-apple-fix.diff
Ref: https://gitlab.gnome.org/GNOME/libxslt/-/issues/139
(From OE-Core rev: 2e2fa1ae7f24dadae9cb8371174aa7744aa42028)
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-support/libxslt/libxslt/CVE-2025-7424.patch | 105 | ||||
| -rw-r--r-- | meta/recipes-support/libxslt/libxslt_1.1.35.bb | 1 |
2 files changed, 106 insertions, 0 deletions
diff --git a/meta/recipes-support/libxslt/libxslt/CVE-2025-7424.patch b/meta/recipes-support/libxslt/libxslt/CVE-2025-7424.patch new file mode 100644 index 0000000000..c6b234a818 --- /dev/null +++ b/meta/recipes-support/libxslt/libxslt/CVE-2025-7424.patch | |||
| @@ -0,0 +1,105 @@ | |||
| 1 | From 345d6826d0eae6f0a962456b8ed6f6a1bad0877d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: David Kilzer <ddkilzer@apple.com> | ||
| 3 | Date: Sat, 24 May 2025 15:06:42 -0700 | ||
| 4 | Subject: [PATCH] libxslt: Type confusion in xmlNode.psvi between stylesheet | ||
| 5 | and source nodes | ||
| 6 | |||
| 7 | * libxslt/functions.c: | ||
| 8 | (xsltDocumentFunctionLoadDocument): | ||
| 9 | - Implement fix suggested by Ivan Fratric. This copies the xmlDoc, | ||
| 10 | calls xsltCleanupSourceDoc() to remove pvsi fields, then adds the | ||
| 11 | xmlDoc to tctxt->docList. | ||
| 12 | - Add error handling for functions that may return NULL. | ||
| 13 | * libxslt/transform.c: | ||
| 14 | - Remove static keyword so this can be called from | ||
| 15 | xsltDocumentFunctionLoadDocument(). | ||
| 16 | * libxslt/transformInternals.h: Add. | ||
| 17 | (xsltCleanupSourceDoc): Add declaration. | ||
| 18 | |||
| 19 | Fixes #139. | ||
| 20 | |||
| 21 | Origin: https://gitlab.gnome.org/-/project/1762/uploads/627ae84cb0643d9adf6e5c86947f6be6/gnome-libxslt-bug-139-apple-fix.diff | ||
| 22 | |||
| 23 | Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/libxslt/-/issues/139] | ||
| 24 | CVE: CVE-2025-7424 | ||
| 25 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 26 | --- | ||
| 27 | libxslt/functions.c | 16 +++++++++++++++- | ||
| 28 | libxslt/transform.c | 3 ++- | ||
| 29 | libxslt/transformInternals.h | 9 +++++++++ | ||
| 30 | 3 files changed, 26 insertions(+), 2 deletions(-) | ||
| 31 | create mode 100644 libxslt/transformInternals.h | ||
| 32 | |||
| 33 | diff --git a/libxslt/functions.c b/libxslt/functions.c | ||
| 34 | index da25c24..8a9bdc2 100644 | ||
| 35 | --- a/libxslt/functions.c | ||
| 36 | +++ b/libxslt/functions.c | ||
| 37 | @@ -41,6 +41,7 @@ | ||
| 38 | #include "numbersInternals.h" | ||
| 39 | #include "keys.h" | ||
| 40 | #include "documents.h" | ||
| 41 | +#include "transformInternals.h" | ||
| 42 | |||
| 43 | #ifdef WITH_XSLT_DEBUG | ||
| 44 | #define WITH_XSLT_DEBUG_FUNCTION | ||
| 45 | @@ -152,7 +153,20 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI) | ||
| 46 | /* | ||
| 47 | * This selects the stylesheet's doc itself. | ||
| 48 | */ | ||
| 49 | - doc = tctxt->style->doc; | ||
| 50 | + doc = xmlCopyDoc(tctxt->style->doc, 1); | ||
| 51 | + if (doc == NULL) { | ||
| 52 | + xsltTransformError(tctxt, NULL, NULL, | ||
| 53 | + "document() : failed to copy style doc\n"); | ||
| 54 | + goto out_fragment; | ||
| 55 | + } | ||
| 56 | + xsltCleanupSourceDoc(doc); /* Remove psvi fields. */ | ||
| 57 | + idoc = xsltNewDocument(tctxt, doc); | ||
| 58 | + if (idoc == NULL) { | ||
| 59 | + xsltTransformError(tctxt, NULL, NULL, | ||
| 60 | + "document() : failed to create xsltDocument\n"); | ||
| 61 | + xmlFreeDoc(doc); | ||
| 62 | + goto out_fragment; | ||
| 63 | + } | ||
| 64 | } else { | ||
| 65 | valuePush(ctxt, xmlXPathNewNodeSet(NULL)); | ||
| 66 | |||
| 67 | diff --git a/libxslt/transform.c b/libxslt/transform.c | ||
| 68 | index 7299eb5..6976a04 100644 | ||
| 69 | --- a/libxslt/transform.c | ||
| 70 | +++ b/libxslt/transform.c | ||
| 71 | @@ -42,6 +42,7 @@ | ||
| 72 | #include "xsltutils.h" | ||
| 73 | #include "pattern.h" | ||
| 74 | #include "transform.h" | ||
| 75 | +#include "transformInternals.h" | ||
| 76 | #include "variables.h" | ||
| 77 | #include "numbersInternals.h" | ||
| 78 | #include "namespaces.h" | ||
| 79 | @@ -5753,7 +5754,7 @@ xsltCountKeys(xsltTransformContextPtr ctxt) | ||
| 80 | * | ||
| 81 | * Resets source node flags and ids stored in 'psvi' member. | ||
| 82 | */ | ||
| 83 | -static void | ||
| 84 | +void | ||
| 85 | xsltCleanupSourceDoc(xmlDocPtr doc) { | ||
| 86 | xmlNodePtr cur = (xmlNodePtr) doc; | ||
| 87 | void **psviPtr; | ||
| 88 | diff --git a/libxslt/transformInternals.h b/libxslt/transformInternals.h | ||
| 89 | new file mode 100644 | ||
| 90 | index 0000000..d0f4282 | ||
| 91 | --- /dev/null | ||
| 92 | +++ b/libxslt/transformInternals.h | ||
| 93 | @@ -0,0 +1,9 @@ | ||
| 94 | +/* | ||
| 95 | + * Summary: set of internal interfaces for the XSLT engine transformation part. | ||
| 96 | + * | ||
| 97 | + * Copy: See Copyright for the status of this software. | ||
| 98 | + * | ||
| 99 | + * Author: David Kilzer <ddkilzer@apple.com> | ||
| 100 | + */ | ||
| 101 | + | ||
| 102 | +void xsltCleanupSourceDoc(xmlDocPtr doc); | ||
| 103 | -- | ||
| 104 | 2.25.1 | ||
| 105 | |||
diff --git a/meta/recipes-support/libxslt/libxslt_1.1.35.bb b/meta/recipes-support/libxslt/libxslt_1.1.35.bb index 2291ed2cad..f1532a05c1 100644 --- a/meta/recipes-support/libxslt/libxslt_1.1.35.bb +++ b/meta/recipes-support/libxslt/libxslt_1.1.35.bb | |||
| @@ -21,6 +21,7 @@ SRC_URI = "https://download.gnome.org/sources/libxslt/1.1/libxslt-${PV}.tar.xz \ | |||
| 21 | file://CVE-2023-40403-003.patch \ | 21 | file://CVE-2023-40403-003.patch \ |
| 22 | file://CVE-2023-40403-004.patch \ | 22 | file://CVE-2023-40403-004.patch \ |
| 23 | file://CVE-2023-40403-005.patch \ | 23 | file://CVE-2023-40403-005.patch \ |
| 24 | file://CVE-2025-7424.patch \ | ||
| 24 | " | 25 | " |
| 25 | 26 | ||
| 26 | SRC_URI[sha256sum] = "8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79" | 27 | SRC_URI[sha256sum] = "8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79" |
