all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Libtiff buffer overflow fix
@ 2016-11-10 23:28 Leo Famulari
  2016-11-11  5:04 ` Kei Kebreau
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2016-11-10 23:28 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 172 bytes --]

This patch fixes a buffer overflow in libtiff:

http://bugzilla.maptools.org/show_bug.cgi?id=2587
http://seclists.org/oss-sec/2016/q4/381

There is no CVE ID assigned yet.

[-- Attachment #1.2: 0001-gnu-libtiff-Fix-a-buffer-overflow.patch --]
[-- Type: text/plain, Size: 3963 bytes --]

From 5f6d86c83f100ca366a9055dfe30b2e3f0cdf0a9 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Thu, 10 Nov 2016 18:23:57 -0500
Subject: [PATCH] gnu: libtiff: Fix a buffer overflow.

* gnu/packages/patches/libtiff-heap-overflow.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/image.scm (libtiff/fixed): Use it.
---
 gnu/local.mk                                     |  1 +
 gnu/packages/image.scm                           |  1 +
 gnu/packages/patches/libtiff-heap-overflow.patch | 40 ++++++++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 gnu/packages/patches/libtiff-heap-overflow.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b3a4cd5..6f8ad14 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -654,6 +654,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libssh-0.6.5-CVE-2016-0739.patch		\
   %D%/packages/patches/libtar-CVE-2013-4420.patch \
   %D%/packages/patches/libtheora-config-guess.patch		\
+  %D%/packages/patches/libtiff-heap-overflow.patch		\
   %D%/packages/patches/libtiff-CVE-2015-8665+CVE-2015-8683.patch \
   %D%/packages/patches/libtiff-CVE-2016-3623.patch		\
   %D%/packages/patches/libtiff-CVE-2016-3945.patch		\
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 601e818..313c265 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -284,6 +284,7 @@ collection of tools for doing simple manipulations of TIFF images.")
               (patches (search-patches
                          "libtiff-oob-accesses-in-decode.patch"
                          "libtiff-oob-write-in-nextdecode.patch"
+                         "libtiff-heap-overflow.patch"
                          "libtiff-CVE-2015-8665+CVE-2015-8683.patch"
                          "libtiff-CVE-2016-3623.patch"
                          "libtiff-CVE-2016-3945.patch"
diff --git a/gnu/packages/patches/libtiff-heap-overflow.patch b/gnu/packages/patches/libtiff-heap-overflow.patch
new file mode 100644
index 0000000..00bebdf
--- /dev/null
+++ b/gnu/packages/patches/libtiff-heap-overflow.patch
@@ -0,0 +1,40 @@
+Fix a heap buffer overflow:
+
+http://bugzilla.maptools.org/show_bug.cgi?id=2587
+
+Patch extracted from upstream CVS repo:
+
+2016-11-10 Even Rouault <even.rouault at spatialys.com>
+
+revision 1.37
+date: 2016-11-09 18:00:49 -0500;  author: erouault;  state: Exp;  lines: +10 -1;  commitid: pzKipPxDJO2dxvtz;
+* libtiff/tif_strip.c: make TIFFNumberOfStrips() return the td->td_nstrips
+value when it is non-zero, instead of recomputing it. This is needed in
+TIFF_STRIPCHOP mode where td_nstrips is modified. Fixes a read outsize of
+array in tiffsplit (or other utilities using TIFFNumberOfStrips()).
+Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2587
+
+Index: libtiff/tif_strip.c
+===================================================================
+RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/tif_strip.c,v
+retrieving revision 1.36
+retrieving revision 1.37
+diff -u -r1.36 -r1.37
+--- a/libtiff/tif_strip.c	7 Jun 2015 22:35:40 -0000	1.36
++++ b/libtiff/tif_strip.c	9 Nov 2016 23:00:49 -0000	1.37
+@@ -63,6 +63,15 @@
+ 	TIFFDirectory *td = &tif->tif_dir;
+ 	uint32 nstrips;
+ 
++    /* If the value was already computed and store in td_nstrips, then return it,
++       since ChopUpSingleUncompressedStrip might have altered and resized the
++       since the td_stripbytecount and td_stripoffset arrays to the new value
++       after the initial affectation of td_nstrips = TIFFNumberOfStrips() in
++       tif_dirread.c ~line 3612.
++       See http://bugzilla.maptools.org/show_bug.cgi?id=2587 */
++    if( td->td_nstrips )
++        return td->td_nstrips;
++
+ 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
+ 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
+ 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
-- 
2.10.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Libtiff buffer overflow fix
  2016-11-10 23:28 Libtiff buffer overflow fix Leo Famulari
@ 2016-11-11  5:04 ` Kei Kebreau
  2016-11-12 16:05   ` Leo Famulari
  0 siblings, 1 reply; 3+ messages in thread
From: Kei Kebreau @ 2016-11-11  5:04 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

Leo Famulari <leo@famulari.name> writes:

> This patch fixes a buffer overflow in libtiff:
>
> http://bugzilla.maptools.org/show_bug.cgi?id=2587
> http://seclists.org/oss-sec/2016/q4/381
>
> There is no CVE ID assigned yet.

LGTM!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Libtiff buffer overflow fix
  2016-11-11  5:04 ` Kei Kebreau
@ 2016-11-12 16:05   ` Leo Famulari
  0 siblings, 0 replies; 3+ messages in thread
From: Leo Famulari @ 2016-11-12 16:05 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

On Fri, Nov 11, 2016 at 12:04:43AM -0500, Kei Kebreau wrote:
> Leo Famulari <leo@famulari.name> writes:
> 
> > This patch fixes a buffer overflow in libtiff:
> >
> > http://bugzilla.maptools.org/show_bug.cgi?id=2587
> > http://seclists.org/oss-sec/2016/q4/381
> >
> > There is no CVE ID assigned yet.
> 
> LGTM!

Pushed with the recently assigned ID, CVE-2016-9273.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-12 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-10 23:28 Libtiff buffer overflow fix Leo Famulari
2016-11-11  5:04 ` Kei Kebreau
2016-11-12 16:05   ` Leo Famulari

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.