diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-07-02 16:18:38 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-04 00:02:16 +0100 |
commit | 8342cc7d2f00d6f881fd4e578f057859cffaa609 (patch) | |
tree | d5a479d2f0fba077176e2ffbac2297121af18c11 /meta | |
parent | 2e6e9c02f91bb9811c5d4a121b1f48b94809ceb1 (diff) | |
download | poky-8342cc7d2f00d6f881fd4e578f057859cffaa609.tar.gz |
ghostscript: fix CVE-2018-10194
https://nvd.nist.gov/vuln/detail/CVE-2018-10194
(From OE-Core rev: 4b56d6a61bfe4ca28d1301ae83898a979d3df73a)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-extended/ghostscript/ghostscript/0001-pdfwrite-Guard-against-trying-to-output-an-infinite-.patch | 49 | ||||
-rw-r--r-- | meta/recipes-extended/ghostscript/ghostscript_9.23.bb | 1 |
2 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-extended/ghostscript/ghostscript/0001-pdfwrite-Guard-against-trying-to-output-an-infinite-.patch b/meta/recipes-extended/ghostscript/ghostscript/0001-pdfwrite-Guard-against-trying-to-output-an-infinite-.patch new file mode 100644 index 0000000000..bac7365f3c --- /dev/null +++ b/meta/recipes-extended/ghostscript/ghostscript/0001-pdfwrite-Guard-against-trying-to-output-an-infinite-.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 39b1e54b2968620723bf32e96764c88797714879 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ken Sharp <ken.sharp@artifex.com> | ||
3 | Date: Wed, 18 Apr 2018 15:46:32 +0100 | ||
4 | Subject: [PATCH] pdfwrite - Guard against trying to output an infinite number | ||
5 | |||
6 | Bug #699255 " Buffer overflow on pprintg1 due to mishandle postscript file data to pdf" | ||
7 | |||
8 | The file uses an enormous parameter to xyxhow, causing an overflow in | ||
9 | the calculation of text positioning (value > 1e39). | ||
10 | |||
11 | Since this is basically a nonsense value, and PostScript only supports | ||
12 | real values up to 1e38, this patch follows the same approach as for | ||
13 | a degenerate CTM, and treats it as 0. | ||
14 | |||
15 | Adobe Acrobat Distiller throws a limitcheck error, so we could do that | ||
16 | instead if this approach proves to be a problem. | ||
17 | |||
18 | Upstream-Status: Backport | ||
19 | git://git.ghostscript.com/ghostpdl.git | ||
20 | CVE: CVE-2018-10194 | ||
21 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
22 | |||
23 | --- | ||
24 | devices/vector/gdevpdts.c | 7 ++++++- | ||
25 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/devices/vector/gdevpdts.c b/devices/vector/gdevpdts.c | ||
28 | index 848ad78..172fe6b 100644 | ||
29 | --- a/devices/vector/gdevpdts.c | ||
30 | +++ b/devices/vector/gdevpdts.c | ||
31 | @@ -103,9 +103,14 @@ append_text_move(pdf_text_state_t *pts, double dw) | ||
32 | static int | ||
33 | set_text_distance(gs_point *pdist, double dx, double dy, const gs_matrix *pmat) | ||
34 | { | ||
35 | - int code = gs_distance_transform_inverse(dx, dy, pmat, pdist); | ||
36 | + int code; | ||
37 | double rounded; | ||
38 | |||
39 | + if (dx > 1e38 || dy > 1e38) | ||
40 | + code = gs_error_undefinedresult; | ||
41 | + else | ||
42 | + code = gs_distance_transform_inverse(dx, dy, pmat, pdist); | ||
43 | + | ||
44 | if (code == gs_error_undefinedresult) { | ||
45 | /* The CTM is degenerate. | ||
46 | Can't know the distance in user space. | ||
47 | -- | ||
48 | 2.7.4 | ||
49 | |||
diff --git a/meta/recipes-extended/ghostscript/ghostscript_9.23.bb b/meta/recipes-extended/ghostscript/ghostscript_9.23.bb index 4b3b370af7..019d99b021 100644 --- a/meta/recipes-extended/ghostscript/ghostscript_9.23.bb +++ b/meta/recipes-extended/ghostscript/ghostscript_9.23.bb | |||
@@ -33,6 +33,7 @@ SRC_URI = "${SRC_URI_BASE} \ | |||
33 | file://ghostscript-9.02-genarch.patch \ | 33 | file://ghostscript-9.02-genarch.patch \ |
34 | file://objarch.h \ | 34 | file://objarch.h \ |
35 | file://cups-no-gcrypt.patch \ | 35 | file://cups-no-gcrypt.patch \ |
36 | file://0001-pdfwrite-Guard-against-trying-to-output-an-infinite-.patch \ | ||
36 | " | 37 | " |
37 | 38 | ||
38 | SRC_URI_class-native = "${SRC_URI_BASE} \ | 39 | SRC_URI_class-native = "${SRC_URI_BASE} \ |