GNU bug report logs

#32181 [PATCH] gnu: ghostscript: Fix CVE-2018-10194.

PackageSource(s)Maintainer(s)
guix-patches PTS Buildd Popcon
Full log

Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

Received: (at submit) by debbugs.gnu.org; 17 Jul 2018 03:34:10 +0000
From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 16 23:34:10 2018
Received: from localhost ([127.0.0.1]:44325 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1ffGkY-0007BZ-3E
	for submit@debbugs.gnu.org; Mon, 16 Jul 2018 23:34:10 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35268)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@famulari.name>) id 1ffGkW-0007B3-AY
 for submit@debbugs.gnu.org; Mon, 16 Jul 2018 23:34:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <leo@famulari.name>) id 1ffGkP-0006uW-RL
 for submit@debbugs.gnu.org; Mon, 16 Jul 2018 23:33:59 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:54495)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <leo@famulari.name>) id 1ffGkP-0006uR-NY
 for submit@debbugs.gnu.org; Mon, 16 Jul 2018 23:33:57 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54469)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <leo@famulari.name>) id 1ffGkO-0003bW-62
 for guix-patches@gnu.org; Mon, 16 Jul 2018 23:33:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <leo@famulari.name>) id 1ffGkJ-0006tA-NY
 for guix-patches@gnu.org; Mon, 16 Jul 2018 23:33:56 -0400
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:42395)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <leo@famulari.name>) id 1ffGkJ-0006sz-FX
 for guix-patches@gnu.org; Mon, 16 Jul 2018 23:33:51 -0400
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 99CB121BC4;
 Mon, 16 Jul 2018 23:33:50 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Mon, 16 Jul 2018 23:33:50 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=date:from:message-id:subject:to:x-me-sender:x-me-sender
 :x-sasl-enc; s=mesmtp; bh=LJf04ONySi5UAV0KmdVGAqmaUfrhLpmZtm+bfO
 HrX2s=; b=QodTt0GIYY22DH8MAH/uam+/ut7iHzycAb1UnzoDo6R1pA0fY5mDBM
 Vck6FrfnwApBDe4Y/biRt/Vy5BbWFfLj4v7PvXBRG46+peJDzKhjDUmehJozY7aK
 o6VX0B5Nxmix2tob2FKCsSZCTlMeBdocKJ0w5c7lfVIDc7I3M3JyM=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=date:from:message-id:subject:to
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=LJf04ONySi5UAV0Km
 dVGAqmaUfrhLpmZtm+bfOHrX2s=; b=ONoEk13r58PFGLUyXv/Ld28/pn5WF7WSO
 oYBiYYP3kz7iF8Yr2tCzk8D7PRzdebytUafZWiJPUbE4Xqht2dFgq++g9YNS3SFZ
 3qTXNJMQrIp8gI1I8JTZPAmvUKt+TNfrVMxh1iFvGs6P5wkk2QYSDImJdDuuclXi
 61sFhPpxGJE03MV1ib3ijg4COmL5Qd7H7y5UfKSyXGLRvtHztMYCj9267nhmnysT
 mowKq4EyZtZwwTRnBwQ2PJKCanKDDgKwMk0CcO/evBAozjwU57oInNZtODGbXzYc
 ckGXOjp1wUisaPMRmDfCkcOdz3CA/3zoXpQNtYFDdh0RjgCtnIyvg==
X-ME-Proxy: <xmx:nmNNW9FSbJlFp5bOV7-LiLWp1m1Qyq9cDXglSHnFco3J5iIHSi2hWQ>
 <xmx:nmNNWyZqs6nijC62GtRNtsItFUAQ9BUGpxZQeZjMS1ADVTeuq65Fng>
 <xmx:nmNNW_oom-tJgCfahxQIgFNZx4rwbOZsPG_XbUWRZ34_8dOk2qs3Kg>
 <xmx:nmNNW5zHcIoaYptLbcXrjr-74hVkzZ94og723db-Ws6IAveV-8Zeuw>
 <xmx:nmNNW8cyzt3Tx3Xo216ucYNkH42IL60QvLYirtKe3dw7Ty_fQkmvaA>
 <xmx:nmNNW8BbUa6oJDLkxLc_kvcJhxVAnCS5PvXCWLvtT8wVgPPpjZ1VYA>
X-ME-Sender: <xms:nmNNW1MlSEsd5XVe4uBsMRBaKN_0QJ1eE_joyHvUUM1z2wPFROVtDg>
Received: from jasmine.lan (c-76-124-202-137.hsd1.pa.comcast.net
 [76.124.202.137])
 by mail.messagingengine.com (Postfix) with ESMTPA id D5EF91025C
 for <guix-patches@gnu.org>; Mon, 16 Jul 2018 23:33:49 -0400 (EDT)
From: Leo Famulari <leo@famulari.name>
To: guix-patches@gnu.org
Subject: [PATCH] gnu: ghostscript: Fix CVE-2018-10194.
Date: Mon, 16 Jul 2018 23:33:45 -0400
Message-Id: <d779b7c331b9e8dbf63288a4ca742f4092ff95e0.1531798424.git.leo@famulari.name>
X-Mailer: git-send-email 2.18.0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -5.1 (-----)
* gnu/packages/ghostscript.scm (ghostscript)[replacement]: New field.
(ghostscript/fixed): New variable.
* gnu/packages/patches/ghostscript-CVE-2018-10194.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/ghostscript.scm                  | 11 ++++
 .../patches/ghostscript-CVE-2018-10194.patch  | 52 +++++++++++++++++++
 3 files changed, 64 insertions(+)
 create mode 100644 gnu/packages/patches/ghostscript-CVE-2018-10194.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index d40b1963d..20a7d17e7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -713,6 +713,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/geoclue-config.patch			\
   %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \
   %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch	\
+  %D%/packages/patches/ghostscript-CVE-2018-10194.patch		\
   %D%/packages/patches/ghostscript-no-header-id.patch		\
   %D%/packages/patches/ghostscript-no-header-uuid.patch		\
   %D%/packages/patches/ghostscript-no-header-creationdate.patch \
diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index 0a6043ba6..1240b1dc1 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -132,6 +132,7 @@ printing, and psresize, for adjusting page sizes.")
 (define-public ghostscript
   (package
     (name "ghostscript")
+    (replacement ghostscript/fixed)
     (version "9.23")
     (source
       (origin
@@ -250,6 +251,16 @@ output file formats and printers.")
     (home-page "https://www.ghostscript.com/")
     (license license:agpl3+)))
 
+(define-public ghostscript/fixed
+  (hidden-package
+    (package
+      (inherit ghostscript)
+      (source
+        (origin
+          (inherit (package-source ghostscript))
+          (patches (append (origin-patches (package-source ghostscript))
+                           (search-patches "ghostscript-CVE-2018-10194.patch"))))))))
+
 (define-public ghostscript/x
   (package/inherit ghostscript
     (name (string-append (package-name ghostscript) "-with-x"))
diff --git a/gnu/packages/patches/ghostscript-CVE-2018-10194.patch b/gnu/packages/patches/ghostscript-CVE-2018-10194.patch
new file mode 100644
index 000000000..242e57c27
--- /dev/null
+++ b/gnu/packages/patches/ghostscript-CVE-2018-10194.patch
@@ -0,0 +1,52 @@
+Fix CVE-2018-10194:
+
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-10194
+https://bugs.ghostscript.com/show_bug.cgi?id=699255
+
+Patch copied from upstream source repository:
+
+https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=39b1e54b2968620723bf32e96764c88797714879
+
+From 39b1e54b2968620723bf32e96764c88797714879 Mon Sep 17 00:00:00 2001
+From: Ken Sharp <ken.sharp@artifex.com>
+Date: Wed, 18 Apr 2018 15:46:32 +0100
+Subject: [PATCH] pdfwrite - Guard against trying to output an infinite number
+
+Bug #699255 " Buffer overflow on pprintg1 due to mishandle postscript file data to pdf"
+
+The file uses an enormous parameter to xyxhow, causing an overflow in
+the calculation of text positioning (value > 1e39).
+
+Since this is basically a nonsense value, and PostScript only supports
+real values up to 1e38, this patch follows the same approach as for
+a degenerate CTM, and treats it as 0.
+
+Adobe Acrobat Distiller throws a limitcheck error, so we could do that
+instead if this approach proves to be a problem.
+---
+ devices/vector/gdevpdts.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/devices/vector/gdevpdts.c b/devices/vector/gdevpdts.c
+index 848ad781f..172fe6bc3 100644
+--- a/devices/vector/gdevpdts.c
++++ b/devices/vector/gdevpdts.c
+@@ -103,9 +103,14 @@ append_text_move(pdf_text_state_t *pts, double dw)
+ static int
+ set_text_distance(gs_point *pdist, double dx, double dy, const gs_matrix *pmat)
+ {
+-    int code = gs_distance_transform_inverse(dx, dy, pmat, pdist);
++    int code;
+     double rounded;
+ 
++    if (dx > 1e38 || dy > 1e38)
++        code = gs_error_undefinedresult;
++    else
++        code = gs_distance_transform_inverse(dx, dy, pmat, pdist);
++
+     if (code == gs_error_undefinedresult) {
+         /* The CTM is degenerate.
+            Can't know the distance in user space.
+-- 
+2.18.0
+
-- 
2.18.0





Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 11:34:44 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.