diff options
| author | Marius Bakke <marius@gnu.org> | 2020-12-08 21:11:19 +0100 |
|---|---|---|
| committer | Marius Bakke <marius@gnu.org> | 2020-12-08 22:57:53 +0100 |
| commit | 3bd218e8d4abde56e7ce9149311df5e60db0e321 (patch) | |
| tree | 156d70367f257d68b2066d8840d34600dea330f3 | |
| parent | 9337c16cb69fd47ca31ebe184d2a37028b978249 (diff) | |
gnu: ghostscript: Fix CVE-2020-15900.
* gnu/packages/patches/ghostscript-CVE-2020-15900.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/ghostscript.scm (ghostscript)[source](patches): Add it.
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/ghostscript.scm | 1 | ||||
| -rw-r--r-- | gnu/packages/patches/ghostscript-CVE-2020-15900.patch | 36 |
3 files changed, 38 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 97dd9a74d00..7f0b69cacf9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1055,6 +1055,7 @@ dist_patch_DATA = \ | |||
| 1055 | %D%/packages/patches/ghc-monad-par-fix-tests.patch \ | 1055 | %D%/packages/patches/ghc-monad-par-fix-tests.patch \ |
| 1056 | %D%/packages/patches/ghc-pandoc-fix-html-tests.patch \ | 1056 | %D%/packages/patches/ghc-pandoc-fix-html-tests.patch \ |
| 1057 | %D%/packages/patches/ghc-pandoc-fix-latex-test.patch \ | 1057 | %D%/packages/patches/ghc-pandoc-fix-latex-test.patch \ |
| 1058 | %D%/packages/patches/ghostscript-CVE-2020-15900.patch \ | ||
| 1058 | %D%/packages/patches/ghostscript-freetype-compat.patch \ | 1059 | %D%/packages/patches/ghostscript-freetype-compat.patch \ |
| 1059 | %D%/packages/patches/ghostscript-no-header-id.patch \ | 1060 | %D%/packages/patches/ghostscript-no-header-id.patch \ |
| 1060 | %D%/packages/patches/ghostscript-no-header-uuid.patch \ | 1061 | %D%/packages/patches/ghostscript-no-header-uuid.patch \ |
diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index b132fba7eb7..03a516dc522 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm | |||
| @@ -171,6 +171,7 @@ printing, and psresize, for adjusting page sizes.") | |||
| 171 | (base32 | 171 | (base32 |
| 172 | "0z1w42y2jmcpl2m1l3z0sfii6zmvzcwcgzn6bydklia6ig7jli2p")) | 172 | "0z1w42y2jmcpl2m1l3z0sfii6zmvzcwcgzn6bydklia6ig7jli2p")) |
| 173 | (patches (search-patches "ghostscript-freetype-compat.patch" | 173 | (patches (search-patches "ghostscript-freetype-compat.patch" |
| 174 | "ghostscript-CVE-2020-15900.patch" | ||
| 174 | "ghostscript-no-header-creationdate.patch" | 175 | "ghostscript-no-header-creationdate.patch" |
| 175 | "ghostscript-no-header-id.patch" | 176 | "ghostscript-no-header-id.patch" |
| 176 | "ghostscript-no-header-uuid.patch")) | 177 | "ghostscript-no-header-uuid.patch")) |
diff --git a/gnu/packages/patches/ghostscript-CVE-2020-15900.patch b/gnu/packages/patches/ghostscript-CVE-2020-15900.patch new file mode 100644 index 00000000000..b6658d7c7f6 --- /dev/null +++ b/gnu/packages/patches/ghostscript-CVE-2020-15900.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | Fix CVE-2020-15900. | ||
| 2 | |||
| 3 | https://cve.circl.lu/cve/CVE-2020-15900 | ||
| 4 | https://artifex.com/security-advisories/CVE-2020-15900 | ||
| 5 | |||
| 6 | Taken from upstream: | ||
| 7 | https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=5d499272b95a6b890a1397e11d20937de000d31b | ||
| 8 | |||
| 9 | diff --git a/psi/zstring.c b/psi/zstring.c | ||
| 10 | --- a/psi/zstring.c | ||
| 11 | +++ b/psi/zstring.c | ||
| 12 | @@ -142,13 +142,18 @@ search_impl(i_ctx_t *i_ctx_p, bool forward) | ||
| 13 | return 0; | ||
| 14 | found: | ||
| 15 | op->tas.type_attrs = op1->tas.type_attrs; | ||
| 16 | - op->value.bytes = ptr; | ||
| 17 | - r_set_size(op, size); | ||
| 18 | + op->value.bytes = ptr; /* match */ | ||
| 19 | + op->tas.rsize = size; /* match */ | ||
| 20 | push(2); | ||
| 21 | - op[-1] = *op1; | ||
| 22 | - r_set_size(op - 1, ptr - op[-1].value.bytes); | ||
| 23 | - op1->value.bytes = ptr + size; | ||
| 24 | - r_set_size(op1, count + (!forward ? (size - 1) : 0)); | ||
| 25 | + op[-1] = *op1; /* pre */ | ||
| 26 | + op[-3].value.bytes = ptr + size; /* post */ | ||
| 27 | + if (forward) { | ||
| 28 | + op[-1].tas.rsize = ptr - op[-1].value.bytes; /* pre */ | ||
| 29 | + op[-3].tas.rsize = count; /* post */ | ||
| 30 | + } else { | ||
| 31 | + op[-1].tas.rsize = count; /* pre */ | ||
| 32 | + op[-3].tas.rsize -= count + size; /* post */ | ||
| 33 | + } | ||
| 34 | make_true(op); | ||
| 35 | return 0; | ||
| 36 | } | ||
