[oe-commits] [openembedded-core] 15/53: tiff: Security fix for CVE-2017-7598

git at git.openembedded.org git at git.openembedded.org
Tue Nov 21 14:44:36 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch morty
in repository openembedded-core.

commit 7e367796d4bf97e299ee966b120f924de0f2bb04
Author: Rajkumar Veer <rveer at mvista.com>
AuthorDate: Fri Nov 3 22:30:13 2017 -0700

    tiff: Security fix for CVE-2017-7598
    
    Signed-off-by: Rajkumar Veer <rveer at mvista.com>
    Signed-off-by: Armin Kuster <akuster at mvista.com>
---
 .../libtiff/files/CVE-2017-7598.patch              | 65 ++++++++++++++++++++++
 meta/recipes-multimedia/libtiff/tiff_4.0.7.bb      |  1 +
 2 files changed, 66 insertions(+)

diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch b/meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch
new file mode 100644
index 0000000..6d082bb
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch
@@ -0,0 +1,65 @@
+From 3cfd62d77c2a7e147a05bd678524c345fa9c2bb8 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Wed, 11 Jan 2017 13:28:01 +0000
+Subject: [PATCH] * libtiff/tif_dirread.c: avoid division by floating point 0
+ in TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(),
+ and return 0 in that case (instead of infinity as before presumably)
+ Apparently some sanitizers do not like those divisions by zero. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2644
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-7598
+Signed-off-by: Rajkumar Veer <rveer at mvista.com>
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-25 16:14:59.858612730 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-25 18:11:36.048107127 +0530
+@@ -1,3 +1,4 @@
++
+ 2017-01-12 Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesQTable,
+@@ -8,6 +9,14 @@
+ 
+ 2017-01-11 Even Rouault <even.rouault at spatialys.com>
+ 
++	* libtiff/tif_dirread.c: avoid division by floating point 0 in
++	TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(),
++	and return 0 in that case (instead of infinity as before presumably)
++	Apparently some sanitizers do not like those divisions by zero.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2644
++
++2017-01-11 Even Rouault <even.rouault at spatialys.com>
++
+ 	* libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement various clampings
+ 	of double to other data types to avoid undefined behaviour if the output range
+ 	isn't big enough to hold the input value.
+Index: tiff-4.0.7/libtiff/tif_dirread.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_dirread.c	2017-04-25 16:14:59.858612730 +0530
++++ tiff-4.0.7/libtiff/tif_dirread.c	2017-04-25 18:16:21.836111576 +0530
+@@ -2880,7 +2880,10 @@
+ 		m.l = direntry->tdir_offset.toff_long8;
+ 	if (tif->tif_flags&TIFF_SWAB)
+ 		TIFFSwabArrayOfLong(m.i,2);
+-	if (m.i[0]==0)
++        /* Not completely sure what we should do when m.i[1]==0, but some */
++        /* sanitizers do not like division by 0.0: */
++        /* http://bugzilla.maptools.org/show_bug.cgi?id=2644 */
++	if (m.i[0]==0 || m.i[1]==0)
+ 		*value=0.0;
+ 	else
+ 		*value=(double)m.i[0]/(double)m.i[1];
+@@ -2908,7 +2911,10 @@
+ 		m.l=direntry->tdir_offset.toff_long8;
+ 	if (tif->tif_flags&TIFF_SWAB)
+ 		TIFFSwabArrayOfLong(m.i,2);
+-	if ((int32)m.i[0]==0)
++        /* Not completely sure what we should do when m.i[1]==0, but some */
++        /* sanitizers do not like division by 0.0: */
++        /* http://bugzilla.maptools.org/show_bug.cgi?id=2644 */
++	if ((int32)m.i[0]==0 || m.i[1]==0)
+ 		*value=0.0;
+ 	else
+ 		*value=(double)((int32)m.i[0])/(double)m.i[1];
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb b/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb
index 77de0be..73deeba 100644
--- a/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb
+++ b/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb
@@ -23,6 +23,7 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
            file://CVE-2017-7594-p2.patch \
            file://CVE-2017-7595.patch \
            file://CVE-2017-7596.patch \
+           file://CVE-2017-7598.patch \
         "
 
 SRC_URI[md5sum] = "77ae928d2c6b7fb46a21c3a29325157b"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list