diff options
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..2f20c66ea3 --- /dev/null +++ b/meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0001.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 5ae2e320d69a7d0973011796bd388cd5befa1a43 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ken Sharp <Ken.Sharp@artifex.com> | ||
| 3 | Date: Tue, 26 Mar 2024 12:02:57 +0000 | ||
| 4 | Subject: [PATCH 2/5] Bug #707691 | ||
| 5 | |||
| 6 | Part 1; when stripping a potential Current Working Dirctory specifier | ||
| 7 | from a path, make certain it really is a CWD, and not simply large | ||
| 8 | ebough to be a CWD. | ||
| 9 | |||
| 10 | Reasons are in the bug thread, this is not (IMO) serious. | ||
| 11 | |||
| 12 | This is part of the fix for CVE-2024-33869 | ||
| 13 | |||
| 14 | CVE: CVE-2024-33869 | ||
| 15 | |||
| 16 | Upstream-Status: Backport [https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=5ae2e320d69a7d0973] | ||
| 17 | |||
| 18 | Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> | ||
| 19 | --- | ||
| 20 | base/gpmisc.c | 4 ++-- | ||
| 21 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/base/gpmisc.c b/base/gpmisc.c | ||
| 24 | index c4a69b0..1d4d5d8 100644 | ||
| 25 | --- a/base/gpmisc.c | ||
| 26 | +++ b/base/gpmisc.c | ||
| 27 | @@ -1164,8 +1164,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 | -- | ||
| 39 | 2.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..5dcbcca998 --- /dev/null +++ b/meta/recipes-extended/ghostscript/ghostscript/CVE-2024-33869-0002.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | From f5336e5b4154f515ac83bc5b9eba94302e6618d4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ken Sharp <Ken.Sharp@artifex.com> | ||
| 3 | Date: Tue, 26 Mar 2024 12:07:18 +0000 | ||
| 4 | Subject: [PATCH 3/5] Bug 707691 part 2 | ||
| 5 | |||
| 6 | See bug thread for details | ||
| 7 | |||
| 8 | This is the second part of the fix for CVE-2024-33869 | ||
| 9 | |||
| 10 | CVE: CVE-2024-33869 | ||
| 11 | |||
| 12 | Upstream-Status: Backport [https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=f5336e5b4154f515ac83] | ||
| 13 | |||
| 14 | Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> | ||
| 15 | --- | ||
| 16 | base/gpmisc.c | 21 +++++++++++++++++++++ | ||
| 17 | 1 file changed, 21 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/base/gpmisc.c b/base/gpmisc.c | ||
| 20 | index 1d4d5d8..b0d5c71 100644 | ||
| 21 | --- a/base/gpmisc.c | ||
| 22 | +++ b/base/gpmisc.c | ||
| 23 | @@ -1090,6 +1090,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 | -- | ||
| 52 | 2.40.0 | ||
diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.02.1.bb b/meta/recipes-extended/ghostscript/ghostscript_10.02.1.bb index ca6f628f38..91285ed2ad 100644 --- a/meta/recipes-extended/ghostscript/ghostscript_10.02.1.bb +++ b/meta/recipes-extended/ghostscript/ghostscript_10.02.1.bb | |||
| @@ -27,6 +27,8 @@ SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/downlo | |||
| 27 | file://avoid-host-contamination.patch \ | 27 | file://avoid-host-contamination.patch \ |
| 28 | file://configure.ac-add-option-to-explicitly-disable-neon.patch \ | 28 | file://configure.ac-add-option-to-explicitly-disable-neon.patch \ |
| 29 | file://CVE-2024-33870.patch \ | 29 | file://CVE-2024-33870.patch \ |
| 30 | file://CVE-2024-33869-0001.patch \ | ||
| 31 | file://CVE-2024-33869-0002.patch \ | ||
| 30 | " | 32 | " |
| 31 | 33 | ||
| 32 | SRC_URI[sha256sum] = "e429e4f5b01615a4f0f93a4128e8a1a4d932dff983b1774174c79c0630717ad9" | 34 | SRC_URI[sha256sum] = "e429e4f5b01615a4f0f93a4128e8a1a4d932dff983b1774174c79c0630717ad9" |
