aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhixiong Chi <zhixiong.chi@windriver.com>2016-11-28 17:52:13 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-18 13:13:38 +0100
commitd80b6e399e2c14b99c629b4548c7ec38e35fe93e (patch)
treeef6fbb655ab3398f8c6161a446ef4805d08a31d8
parent6f58c18016258c0a49b4d0ef50d170a1bbb671f4 (diff)
downloadopenembedded-core-d80b6e399e2c14b99c629b4548c7ec38e35fe93e.zip
openembedded-core-d80b6e399e2c14b99c629b4548c7ec38e35fe93e.tar.gz
openembedded-core-d80b6e399e2c14b99c629b4548c7ec38e35fe93e.tar.bz2
tiff: Security fix CVE-2016-9539
tools/tiffcrop.c in libtiff 4.0.6 has an out-of-bounds read in readContigTilesIntoBuffer(). Reported as MSVR 35092. External References: https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-9539 Patch from: https://github.com/vadz/libtiff/commit/ae9365db1b271b62b35ce018eac8799b1d5e8a53 (From OE-Core rev: 58bf0a237ca28459eb8c3afa030c0054f5bc1f16) (From OE-Core rev: 0933a11707a369c8eaefebd31e8eea634084d66e) Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/recipes-multimedia/libtiff/files/CVE-2016-9539.patch60
-rw-r--r--meta/recipes-multimedia/libtiff/tiff_4.0.6.bb1
2 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2016-9539.patch b/meta/recipes-multimedia/libtiff/files/CVE-2016-9539.patch
new file mode 100644
index 0000000..1d9be42
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/CVE-2016-9539.patch
@@ -0,0 +1,60 @@
+From ae9365db1b271b62b35ce018eac8799b1d5e8a53 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Fri, 14 Oct 2016 19:13:20 +0000
+Subject: [PATCH ] * tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes
+ in readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel Souchet
+ & Vishal Chauhan from the MSRC Vulnerabilities & Mitigations team.
+
+CVE: CVE-2016-9539
+
+Upstream-Status: Backport
+https://github.com/vadz/libtiff/commit/ae9365db1b271b62b35ce018eac8799b1d5e8a53
+
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+
+---
+ ChangeLog | 6 ++++++
+ tools/tiffcrop.c | 11 ++++++++++-
+ 2 files changed, 16 insertions(+), 1 deletion(-)
+
+Index: tiff-4.0.6/ChangeLog
+===================================================================
+--- tiff-4.0.6.orig/ChangeLog 2016-11-28 14:56:32.109283913 +0800
++++ tiff-4.0.6/ChangeLog 2016-11-28 16:36:01.805325534 +0800
+@@ -17,6 +17,12 @@
+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2500
+ (CVE-2014-8127, duplicate: CVE-2016-3658)
+
++2016-10-14 Even Rouault <even.rouault at spatialys.com>
++
++ * tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes in
++ readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel Souchet
++ & Vishal Chauhan from the MSRC Vulnerabilities & Mitigations team.
++
+ 2016-10-08 Even Rouault <even.rouault at spatialys.com>
+
+ * tools/tiffcp.c: fix out-of-bounds write on tiled images with odd
+Index: tiff-4.0.6/tools/tiffcrop.c
+===================================================================
+--- tiff-4.0.6.orig/tools/tiffcrop.c 2016-11-28 14:56:31.433283908 +0800
++++ tiff-4.0.6/tools/tiffcrop.c 2016-11-28 16:42:13.793328128 +0800
+@@ -819,9 +819,18 @@
+ }
+ }
+
+- tilebuf = _TIFFmalloc(tile_buffsize);
++ /* Add 3 padding bytes for extractContigSamplesShifted32bits */
++ if( tile_buffsize > 0xFFFFFFFFU - 3 )
++ {
++ TIFFError("readContigTilesIntoBuffer", "Integer overflow when calculating buffer size.");
++ exit(-1);
++ }
++ tilebuf = _TIFFmalloc(tile_buffsize + 3);
+ if (tilebuf == 0)
+ return 0;
++ tilebuf[tile_buffsize] = 0;
++ tilebuf[tile_buffsize+1] = 0;
++ tilebuf[tile_buffsize+2] = 0;
+
+ dst_rowsize = ((imagewidth * bps * spp) + 7) / 8;
+ for (row = 0; row < imagelength; row += tl)
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb b/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
index 3057121..3a7906a 100644
--- a/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
+++ b/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
@@ -18,6 +18,7 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
file://CVE-2016-3658.patch \
file://CVE-2016-3632.patch \
file://CVE-2016-9540.patch \
+ file://CVE-2016-9539.patch \
"
SRC_URI[md5sum] = "d1d2e940dea0b5ad435f21f03d96dd72"