From 064397ec60f9c0ccabd9dfdea604c82c7cc102d52d969d9307754213af2ae186 Mon Sep 17 00:00:00 2001 From: Johannes Meixner Date: Wed, 12 Jan 2022 09:39:16 +0000 Subject: [PATCH] Accepting request 945778 from home:jsmeix:branches:Printing Ghostscript security fix CVE-2021-45949 (bsc#1194304) including CVE-2021-45944 (bsc#1194303) OBS-URL: https://build.opensuse.org/request/show/945778 OBS-URL: https://build.opensuse.org/package/show/Printing/ghostscript?expand=0&rev=148 --- CVE-2021-45949.patch | 36 ++++++++++++++++++++++++++++++++++++ ghostscript-mini.changes | 11 +++++++++++ ghostscript-mini.spec | 14 +++++++++++++- ghostscript.changes | 11 +++++++++++ ghostscript.spec | 14 +++++++++++++- 5 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 CVE-2021-45949.patch diff --git a/CVE-2021-45949.patch b/CVE-2021-45949.patch new file mode 100644 index 0000000..dd17e10 --- /dev/null +++ b/CVE-2021-45949.patch @@ -0,0 +1,36 @@ +--- psi/zfsample.c.orig 2022-01-12 09:16:07.639604741 +0100 ++++ psi/zfsample.c 2022-01-12 09:21:45.187952236 +0100 +@@ -535,13 +535,16 @@ sampled_data_continue(i_ctx_t *i_ctx_p) + } + pop(num_out); /* Move op to base of result values */ + ++ /* From here on, we have to use ref_stack_pop() rather than pop() ++ so that it handles stack extension blocks properly, before calling ++ sampled_data_sample() which also uses the op stack. ++ */ + /* Check if we are done collecting data. */ +- + if (increment_cube_indexes(params, penum->indexes)) { + if (stack_depth_adjust == 0) +- pop(O_STACK_PAD); /* Remove spare stack space */ ++ ref_stack_pop(&o_stack, O_STACK_PAD); /* Remove spare stack space */ + else +- pop(stack_depth_adjust - num_out); ++ ref_stack_pop(&o_stack, stack_depth_adjust - num_out); + /* Execute the closing procedure, if given */ + code = 0; + if (esp_finish_proc != 0) +@@ -554,11 +557,11 @@ sampled_data_continue(i_ctx_t *i_ctx_p) + if ((O_STACK_PAD - stack_depth_adjust) < 0) { + stack_depth_adjust = -(O_STACK_PAD - stack_depth_adjust); + check_op(stack_depth_adjust); +- pop(stack_depth_adjust); ++ ref_stack_pop(&o_stack, stack_depth_adjust); + } + else { + check_ostack(O_STACK_PAD - stack_depth_adjust); +- push(O_STACK_PAD - stack_depth_adjust); ++ ref_stack_push(&o_stack, O_STACK_PAD - stack_depth_adjust); + for (i=0;i