aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2016-08-10 15:11:20 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-23 23:21:43 +0100
commit4e2f4484d6e1418c34f65de954809d06df41cc38 (patch)
tree018f733e262c54b94cd52c4854c7c8c427dbca0d
parent35a7cb62be554e28f64b7583d46d693ea184491f (diff)
downloadopenembedded-core-contrib-4e2f4484d6e1418c34f65de954809d06df41cc38.tar.gz
tiff: Security fix CVE-2016-5323
CVE-2016-5323 libtiff: a maliciously crafted TIFF file could cause the application to crash when using tiffcrop command External References: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-5323 http://bugzilla.maptools.org/show_bug.cgi?id=2559 Patch from: https://github.com/vadz/libtiff/commit/2f79856097f423eb33796a15fcf700d2ea41bf31 Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit 4ad1220e0a7f9ca9096860f4f9ae7017b36e29e4) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/recipes-multimedia/libtiff/files/CVE-2016-5323.patch103
-rw-r--r--meta/recipes-multimedia/libtiff/tiff_4.0.4.bb1
2 files changed, 104 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2016-5323.patch b/meta/recipes-multimedia/libtiff/files/CVE-2016-5323.patch
new file mode 100644
index 0000000000..aaad423029
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/CVE-2016-5323.patch
@@ -0,0 +1,103 @@
+From 2f79856097f423eb33796a15fcf700d2ea41bf31 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Mon, 11 Jul 2016 21:38:31 +0000
+Subject: [PATCH 2/2] (CVE-2016-5321 / CVE-2016-5323 , bugzilla #2558 / #2559)
+
+CVE: CVE-2016-5323
+Upstream-Status: Backport
+https://github.com/vadz/libtiff/commit/2f79856097f423eb33796a15fcf700d2ea41bf31
+
+Signed-off-by: Yi Zhao <yi.zhao@windirver.com>
+---
+ tools/tiffcrop.c | 16 ++++++++--------
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+Index: tiff-4.0.4/tools/tiffcrop.c
+===================================================================
+--- tiff-4.0.4.orig/tools/tiffcrop.c
++++ tiff-4.0.4/tools/tiffcrop.c
+@@ -3738,7 +3738,7 @@ combineSeparateSamples8bits (uint8 *in[]
+
+ matchbits = maskbits << (8 - src_bit - bps);
+ /* load up next sample from each plane */
+- for (s = 0; s < spp; s++)
++ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
+ {
+ src = in[s] + src_offset + src_byte;
+ buff1 = ((*src) & matchbits) << (src_bit);
+@@ -3837,7 +3837,7 @@ combineSeparateSamples16bits (uint8 *in[
+ src_bit = bit_offset % 8;
+
+ matchbits = maskbits << (16 - src_bit - bps);
+- for (s = 0; s < spp; s++)
++ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
+ {
+ src = in[s] + src_offset + src_byte;
+ if (little_endian)
+@@ -3947,7 +3947,7 @@ combineSeparateSamples24bits (uint8 *in[
+ src_bit = bit_offset % 8;
+
+ matchbits = maskbits << (32 - src_bit - bps);
+- for (s = 0; s < spp; s++)
++ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
+ {
+ src = in[s] + src_offset + src_byte;
+ if (little_endian)
+@@ -4073,7 +4073,7 @@ combineSeparateSamples32bits (uint8 *in[
+ src_bit = bit_offset % 8;
+
+ matchbits = maskbits << (64 - src_bit - bps);
+- for (s = 0; s < spp; s++)
++ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
+ {
+ src = in[s] + src_offset + src_byte;
+ if (little_endian)
+@@ -4263,7 +4263,7 @@ combineSeparateTileSamples8bits (uint8 *
+
+ matchbits = maskbits << (8 - src_bit - bps);
+ /* load up next sample from each plane */
+- for (s = 0; s < spp; s++)
++ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
+ {
+ src = in[s] + src_offset + src_byte;
+ buff1 = ((*src) & matchbits) << (src_bit);
+@@ -4362,7 +4362,7 @@ combineSeparateTileSamples16bits (uint8
+ src_bit = bit_offset % 8;
+
+ matchbits = maskbits << (16 - src_bit - bps);
+- for (s = 0; s < spp; s++)
++ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
+ {
+ src = in[s] + src_offset + src_byte;
+ if (little_endian)
+@@ -4471,7 +4471,7 @@ combineSeparateTileSamples24bits (uint8
+ src_bit = bit_offset % 8;
+
+ matchbits = maskbits << (32 - src_bit - bps);
+- for (s = 0; s < spp; s++)
++ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
+ {
+ src = in[s] + src_offset + src_byte;
+ if (little_endian)
+@@ -4597,7 +4597,7 @@ combineSeparateTileSamples32bits (uint8
+ src_bit = bit_offset % 8;
+
+ matchbits = maskbits << (64 - src_bit - bps);
+- for (s = 0; s < spp; s++)
++ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
+ {
+ src = in[s] + src_offset + src_byte;
+ if (little_endian)
+Index: tiff-4.0.4/ChangeLog
+===================================================================
+--- tiff-4.0.4.orig/ChangeLog
++++ tiff-4.0.4/ChangeLog
+@@ -3,7 +3,7 @@
+ * tools/tiffcrop.c: Avoid access outside of stack allocated array
+ on a tiled separate TIFF with more than 8 samples per pixel.
+ Reported by Kaixiang Zhang of the Cloud Security Team, Qihoo 360
+- (CVE-2016-5321, bugzilla #2558)
++ (CVE-2016-5321 / CVE-2016-5323 , bugzilla #2558 / #2559)
+
+ 2015-12-26 Even Rouault <even.rouault at spatialys.com>
+
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.0.4.bb b/meta/recipes-multimedia/libtiff/tiff_4.0.4.bb
index 2e97653d95..1f0585a25c 100644
--- a/meta/recipes-multimedia/libtiff/tiff_4.0.4.bb
+++ b/meta/recipes-multimedia/libtiff/tiff_4.0.4.bb
@@ -10,6 +10,7 @@ SRC_URI = "ftp://ftp.remotesensing.org/pub/libtiff/tiff-${PV}.tar.gz \
file://CVE-2015-8665_8683.patch \
file://CVE-2016-3186.patch \
file://CVE-2016-5321.patch \
+ file://CVE-2016-5323.patch \
"
SRC_URI[md5sum] = "9aee7107408a128c0c7b24286c0db900"