summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0001.patch39
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0002.patch52
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb2
3 files changed, 93 insertions, 0 deletions
diff --git a/meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0001.patch b/meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0001.patch
new file mode 100644
index 0000000000..2e60ae6048
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0001.patch
@@ -0,0 +1,39 @@
1From 5ae2e320d69a7d0973011796bd388cd5befa1a43 Mon Sep 17 00:00:00 2001
2From: Ken Sharp <Ken.Sharp@artifex.com>
3Date: Tue, 26 Mar 2024 12:02:57 +0000
4Subject: [PATCH 2/5] Bug #707691
5
6Part 1; when stripping a potential Current Working Dirctory specifier
7from a path, make certain it really is a CWD, and not simply large
8ebough to be a CWD.
9
10Reasons are in the bug thread, this is not (IMO) serious.
11
12This is part of the fix for CVE-2024-33869
13
14CVE: CVE-2024-33869
15
16Upstream-Status: Backport [https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=5ae2e320d69a7d0973]
17
18Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
19---
20 base/gpmisc.c | 4 ++--
21 1 file changed, 2 insertions(+), 2 deletions(-)
22
23diff --git a/base/gpmisc.c b/base/gpmisc.c
24index 3b6fffa..a0b58c8 100644
25--- a/base/gpmisc.c
26+++ b/base/gpmisc.c
27@@ -1162,8 +1162,8 @@ gp_validate_path_len(const gs_memory_t *mem,
28
29 continue;
30 }
31- else if (code < 0 && cdirstrl > 0 && prefix_len == 0 && buffer == bufferfull) {
32- buffer = bufferfull + cdirstrl + dirsepstrl;
33+ else if (code < 0 && cdirstrl > 0 && prefix_len == 0 && buffer == bufferfull
34+ && memcmp(buffer, cdirstr, cdirstrl) && !memcmp(buffer + cdirstrl, dirsepstr, dirsepstrl)) {
35 continue;
36 }
37 break;
38--
392.40.0
diff --git a/meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0002.patch b/meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0002.patch
new file mode 100644
index 0000000000..5ba038a0e7
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0002.patch
@@ -0,0 +1,52 @@
1From f5336e5b4154f515ac83bc5b9eba94302e6618d4 Mon Sep 17 00:00:00 2001
2From: Ken Sharp <Ken.Sharp@artifex.com>
3Date: Tue, 26 Mar 2024 12:07:18 +0000
4Subject: [PATCH 3/5] Bug 707691 part 2
5
6See bug thread for details
7
8This is the second part of the fix for CVE-2024-33869
9
10CVE: CVE-2024-33869
11
12Upstream-Status: Backport [https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=f5336e5b4154f515ac83]
13
14Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
15---
16 base/gpmisc.c | 21 +++++++++++++++++++++
17 1 file changed, 21 insertions(+)
18
19diff --git a/base/gpmisc.c b/base/gpmisc.c
20index a0b58c8..69bee47 100644
21--- a/base/gpmisc.c
22+++ b/base/gpmisc.c
23@@ -1089,6 +1089,27 @@ gp_validate_path_len(const gs_memory_t *mem,
24 rlen = len;
25 }
26 else {
27+ char *test = (char *)path, *test1;
28+ uint tlen = len, slen;
29+
30+ /* Look for any pipe (%pipe% or '|' specifications between path separators
31+ * Reject any path spec which has a %pipe% or '|' anywhere except at the start.
32+ */
33+ while (tlen > 0) {
34+ if (test[0] == '|' || (tlen > 5 && memcmp(test, "%pipe", 5) == 0)) {
35+ code = gs_note_error(gs_error_invalidfileaccess);
36+ goto exit;
37+ }
38+ test1 = test;
39+ slen = search_separator((const char **)&test, path + len, test1, 1);
40+ if(slen == 0)
41+ break;
42+ test += slen;
43+ tlen -= test - test1;
44+ if (test >= path + len)
45+ break;
46+ }
47+
48 rlen = len+1;
49 bufferfull = (char *)gs_alloc_bytes(mem->thread_safe_memory, rlen + prefix_len, "gp_validate_path");
50 if (bufferfull == NULL)
51--
522.40.0
diff --git a/meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb b/meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb
index 5fa4da0fb8..083ee4b337 100644
--- a/meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb
+++ b/meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb
@@ -44,6 +44,8 @@ SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/d
44 file://CVE-2023-43115.patch \ 44 file://CVE-2023-43115.patch \
45 file://CVE-2023-46751.patch \ 45 file://CVE-2023-46751.patch \
46 file://CVE-2024-33870.patch \ 46 file://CVE-2024-33870.patch \
47 file://CVE-2024-33869-0001.patch \
48 file://CVE-2024-33869-0002.patch \
47" 49"
48 50
49SRC_URI = "${SRC_URI_BASE} \ 51SRC_URI = "${SRC_URI_BASE} \