summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJoe Slater <joe.slater@windriver.com>2023-04-24 14:04:10 -0700
committerSteve Sakoman <steve@sakoman.com>2023-05-03 04:17:12 -1000
commit20e0e5ebfb4267d212a77ac414a53b0725c0e53e (patch)
tree4ea3358fb6f1e2c1012d5bb96d93b8d2862bf863 /meta
parent6cff3875fe60802742937a5e562d5954f0eb50fe (diff)
downloadpoky-20e0e5ebfb4267d212a77ac414a53b0725c0e53e.tar.gz
ghostscript: fix CVE-2023-29979
Backport from 10.02.0 (unreleased). (From OE-Core rev: 6d5baff50aa83c663856cccc375c522add97625e) Signed-off-by: Joe Slater <joe.slater@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript/cve-2023-28879.patch60
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb1
2 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-extended/ghostscript/ghostscript/cve-2023-28879.patch b/meta/recipes-extended/ghostscript/ghostscript/cve-2023-28879.patch
new file mode 100644
index 0000000000..9b057d609a
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/cve-2023-28879.patch
@@ -0,0 +1,60 @@
1From 37ed5022cecd584de868933b5b60da2e995b3179 Mon Sep 17 00:00:00 2001
2From: Ken Sharp <ken.sharp@artifex.com>
3Date: Fri, 24 Mar 2023 13:19:57 +0000
4Subject: [PATCH] Graphics library - prevent buffer overrun in (T)BCP encoding
5
6Bug #706494 "Buffer Overflow in s_xBCPE_process"
7
8As described in detail in the bug report, if the write buffer is filled
9to one byte less than full, and we then try to write an escaped
10character, we overrun the buffer because we don't check before
11writing two bytes to it.
12
13This just checks if we have two bytes before starting to write an
14escaped character and exits if we don't (replacing the consumed byte
15of the input).
16
17Up for further discussion; why do we even permit a BCP encoding filter
18anyway ? I think we should remove this, at least when SAFER is true.
19---
20CVE: CVE-2023-28879
21
22Upstream-Status: Backport [see text]
23
24git://git.ghostscript.com/ghostpdl
25cherry-pick
26
27Signed-off-by: Joe Slater <joe.slater@windriver.com>
28
29---
30 base/sbcp.c | 10 +++++++++-
31 1 file changed, 9 insertions(+), 1 deletion(-)
32
33diff --git a/base/sbcp.c b/base/sbcp.c
34index 979ae0992..47fc233ec 100644
35--- a/base/sbcp.c
36+++ b/base/sbcp.c
37@@ -1,4 +1,4 @@
38-/* Copyright (C) 2001-2021 Artifex Software, Inc.
39+/* Copyright (C) 2001-2023 Artifex Software, Inc.
40 All Rights Reserved.
41
42 This software is provided AS-IS with no warranty, either express or
43@@ -50,6 +50,14 @@ s_xBCPE_process(stream_state * st, stream_cursor_read * pr,
44 byte ch = *++p;
45
46 if (ch <= 31 && escaped[ch]) {
47+ /* Make sure we have space to store two characters in the write buffer,
48+ * if we don't then exit without consuming the input character, we'll process
49+ * that on the next time round.
50+ */
51+ if (pw->limit - q < 2) {
52+ p--;
53+ break;
54+ }
55 if (p == rlimit) {
56 p--;
57 break;
58--
592.25.1
60
diff --git a/meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb b/meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb
index 365420fb64..f29c57beea 100644
--- a/meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb
+++ b/meta/recipes-extended/ghostscript/ghostscript_9.55.0.bb
@@ -34,6 +34,7 @@ SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/d
34 file://avoid-host-contamination.patch \ 34 file://avoid-host-contamination.patch \
35 file://mkdir-p.patch \ 35 file://mkdir-p.patch \
36 file://CVE-2022-2085.patch \ 36 file://CVE-2022-2085.patch \
37 file://cve-2023-28879.patch \
37" 38"
38 39
39SRC_URI = "${SRC_URI_BASE} \ 40SRC_URI = "${SRC_URI_BASE} \