From e655cfa746e5742a96442d596f0b4ead9cfd478e Mon Sep 17 00:00:00 2001 From: xuchenchen Date: Mon, 6 May 2024 16:53:35 +0800 Subject: [PATCH] fix cve-2023-52722 (cherry picked from commit 93b289aeee375288bf77f0b36a86c54c6a16ca0b) --- fix-cve-2023-52722.patch | 38 ++++++++++++++++++++++++++++++++++++++ ghostscript.spec | 9 ++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 fix-cve-2023-52722.patch diff --git a/fix-cve-2023-52722.patch b/fix-cve-2023-52722.patch new file mode 100644 index 0000000..2ffdac4 --- /dev/null +++ b/fix-cve-2023-52722.patch @@ -0,0 +1,38 @@ +From afd7188f74918cb51b5fb89f52b54eb16e8acfd1 Mon Sep 17 00:00:00 2001 +From: Chris Liddell +Date: 2023-09-12 10:46:10 +0100 +Subject: [PATCH] In SAFER (default) don't allow eexec seeds other than the Type 1 standard + +--- + psi/zmisc1.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/psi/zmisc1.c b/psi/zmisc1.c +index 3c47e99..81556ac 100644 +--- a/psi/zmisc1.c ++++ b/psi/zmisc1.c +@@ -93,6 +93,9 @@ zexE(i_ctx_t *i_ctx_p) + + if (code < 0) + return code; ++ if (gs_is_path_control_active(imemory) != 0 && state.cstate != 55665) { ++ return_error(gs_error_rangecheck); ++ } + return filter_write(i_ctx_p, code, &s_exE_template, (stream_state *)&state, 0); + } + +@@ -130,6 +133,11 @@ zexD(i_ctx_t *i_ctx_p) + } + if (code < 0) + return code; ++ ++ if (gs_is_path_control_active(imemory) != 0 && state.cstate != 55665) { ++ return_error(gs_error_rangecheck); ++ } ++ + /* + * If we're reading a .PFB file, let the filter know about it, + * so it can read recklessly to the end of the binary section. +-- +2.27.0 + diff --git a/ghostscript.spec b/ghostscript.spec index e0f274a..a093528 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -9,7 +9,7 @@ Name: ghostscript Version: 9.55.0 -Release: 6 +Release: 7 Summary: An interpreter for PostScript and PDF files License: AGPLv3+ URL: https://ghostscript.com/ @@ -22,6 +22,7 @@ Patch3: CVE-2023-38559.patch Patch4: CVE-2023-28879.patch Patch5: CVE-2023-36664.patch Patch6: CVE-2023-46751.patch +Patch7: fix-cve-2023-52722.patch BuildRequires: automake gcc BuildRequires: adobe-mappings-cmap-devel adobe-mappings-pdf-devel @@ -182,6 +183,12 @@ install -m 0755 -d %{buildroot}%{_datadir}/%{name}/conf.d/ %{_bindir}/dvipdf %changelog +* Mon May 6 2024 xuchenchen - 9.55.0-7 +- Type:CVE +- ID:NA +- SUG:NA +- DECS: fix CVE-2023-52722 + * Mon Dec 25 2023 liningjie - 9.55.0-6 - fix CVE-2023-46751 -- Gitee