summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ghostscript/ghostscript/CVE-2019-3835-0001.patch
diff options
context:
space:
mode:
authorOvidiu Panait <ovidiu.panait@windriver.com>2019-04-05 17:56:31 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-09 13:44:39 +0100
commit327513ee83499827b6f4a8fae2ba0336b65bb68a (patch)
tree4fcd2fded9d4cc1f302db18cfabe3fea7425215e /meta/recipes-extended/ghostscript/ghostscript/CVE-2019-3835-0001.patch
parenta1fb2c59e82fd5ccc1d8ae649af7f1979cee3939 (diff)
downloadpoky-327513ee83499827b6f4a8fae2ba0336b65bb68a.tar.gz
ghostscript: Fix 3 CVEs
It was discovered that the ghostscript /invalidaccess checks fail under certain conditions. An attacker could possibly exploit this to bypass the -dSAFER protection and, for example, execute arbitrary shell commands via a specially crafted PostScript document. It was found that the superexec operator was available in the internal dictionary in ghostscript before 9.27. A specially crafted PostScript file could use this flaw in order to, for example, have access to the file system outside of the constrains imposed by -dSAFER. It was found that the forceput operator could be extracted from the DefineResource method in ghostscript before 9.27. A specially crafted PostScript file could use this flaw in order to, for example, have access to the file system outside of the constrains imposed by -dSAFER. References: https://nvd.nist.gov/vuln/detail/CVE-2019-6116 https://www.openwall.com/lists/oss-security/2019/01/23/5 https://nvd.nist.gov/vuln/detail/CVE-2019-3835 https://nvd.nist.gov/vuln/detail/CVE-2019-3838 Upstream patches: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=13b0a36 http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=2db98f9 http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=99f1309 http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=59d8f4d http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=2768d1a http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=49c8092 http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=2ff600a http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=779664d http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=e8acf6d http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=2055917 http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=d683d1e http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=ed9fcd9 http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=a82601e (From OE-Core rev: 12e140dfdac8456772223c816e37bd869419bb18) Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/ghostscript/ghostscript/CVE-2019-3835-0001.patch')
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript/CVE-2019-3835-0001.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/meta/recipes-extended/ghostscript/ghostscript/CVE-2019-3835-0001.patch b/meta/recipes-extended/ghostscript/ghostscript/CVE-2019-3835-0001.patch
new file mode 100644
index 0000000000..30ce04a7b1
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/CVE-2019-3835-0001.patch
@@ -0,0 +1,99 @@
1From ad3ad6b389653722507e588c5cb34d8731e49e89 Mon Sep 17 00:00:00 2001
2From: Chris Liddell <chris.liddell@artifex.com>
3Date: Mon, 26 Nov 2018 18:01:25 +0000
4Subject: [PATCH] Have gs_cet.ps run from gs_init.ps
5
6Previously gs_cet.ps was run on the command line, to set up the interpreter
7state so our output more closely matches the example output for the QL CET
8tests.
9
10Allow a -dCETMODE command line switch, which will cause gs_init.ps to run the
11file directly.
12
13This works better for gpdl as it means the changes are made in the intial
14interpreter state, rather than after initialisation is complete.
15
16This also means adding a definition of the default procedure for black
17generation and under color removal (rather it being defined in-line in
18.setdefaultbgucr
19
20Also, add a check so gs_cet.ps only runs once - if we try to run it a second
21time, we'll just skip over the file, flushing through to the end.
22
23CVE: CVE-2019-3835
24Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
25
26Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
27---
28 Resource/Init/gs_cet.ps | 11 ++++++++++-
29 Resource/Init/gs_init.ps | 13 ++++++++++++-
30 2 files changed, 22 insertions(+), 2 deletions(-)
31
32diff --git a/Resource/Init/gs_cet.ps b/Resource/Init/gs_cet.ps
33index d3e1686..75534bb 100644
34--- a/Resource/Init/gs_cet.ps
35+++ b/Resource/Init/gs_cet.ps
36@@ -1,6 +1,11 @@
37 %!PS
38 % Set defaults for Ghostscript to match Adobe CPSI behaviour for CET
39
40+systemdict /product get (PhotoPRINT SE 5.0v2) readonly eq
41+{
42+ (%END GS_CET) .skipeof
43+} if
44+
45 % do this in the server level so it is persistent across jobs
46 //true 0 startjob not {
47 (*** Warning: CET startup is not in server default) = flush
48@@ -25,7 +30,9 @@ currentglobal //true setglobal
49
50 /UNROLLFORMS true def
51
52-{ } bind dup
53+(%.defaultbgrucrproc) cvn { } bind def
54+
55+(%.defaultbgrucrproc) cvn load dup
56 setblackgeneration
57 setundercolorremoval
58 0 array cvx readonly dup dup dup setcolortransfer
59@@ -109,3 +116,5 @@ userdict /.smoothness currentsmoothness put
60 % end of slightly nasty hack to give consistent cluster results
61
62 //false 0 startjob pop % re-enter encapsulated mode
63+
64+%END GS_CET
65diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
66index 45bebf4..e6b9cd2 100644
67--- a/Resource/Init/gs_init.ps
68+++ b/Resource/Init/gs_init.ps
69@@ -1538,10 +1538,18 @@ setpacking
70 % any-part-of-pixel rule.
71 0.5 .setfilladjust
72 } bind def
73+
74 % Set the default screen and BG/UCR.
75+% We define the proc here, rather than inline in .setdefaultbgucr
76+% for the benefit of gs_cet.ps so jobs that do anything that causes
77+% .setdefaultbgucr to be called will still get the redefined proc
78+% in gs_cet.ps
79+(%.defaultbgrucrproc) cvn { pop 0 } def
80+
81 /.setdefaultbgucr {
82 systemdict /setblackgeneration known {
83- { pop 0 } dup setblackgeneration setundercolorremoval
84+ (%.defaultbgrucrproc) cvn load dup
85+ setblackgeneration setundercolorremoval
86 } if
87 } bind def
88 /.useloresscreen { % - .useloresscreen <bool>
89@@ -2491,4 +2499,7 @@ WRITESYSTEMDICT {
90 % be 'true' in some cases.
91 userdict /AGM_preserve_spots //false put
92
93+systemdict /CETMODE .knownget
94+{ { (gs_cet.ps) runlibfile } if } if
95+
96 % The interpreter will run the initial procedure (start).
97--
982.18.1
99