summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhixiong Chi <zhixiong.chi@windriver.com>2016-11-28 08:12:04 (GMT)
committerSona Sarmadi <sona.sarmadi@enea.com>2017-02-10 11:21:39 (GMT)
commit570f9f9c8ba5c5772152dac6203d317e44d00889 (patch)
treeda36f2c12218c82c45765a0f25185c60d05bdf86
parent22869bb8c9fe6e8cc9f6ef282f2729b133b98912 (diff)
downloadpoky-570f9f9c8ba5c5772152dac6203d317e44d00889.tar.gz
tiff: Security fix CVE-2016-9540
tools/tiffcp.c in libtiff 4.0.6 has an out-of-bounds write on tiled images with odd tile width versus image width. Reported as MSVR 35103, aka "cpStripToTile heap-buffer-overflow." External References: https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-9540 Patch from: https://github.com/vadz/libtiff/commit/5ad9d8016fbb60109302d558f7edb2cb2a3bb8e3 (From OE-Core rev: cc97dc66006c7892473e3b4790d05e12445bb927) (From OE-Core rev: ad2c4710ef15c35f6dd4e7642efbceb2cbf81736) 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> Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
-rw-r--r--meta/recipes-multimedia/libtiff/files/CVE-2016-9540.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-9540.patch b/meta/recipes-multimedia/libtiff/files/CVE-2016-9540.patch
new file mode 100644
index 0000000..dddaa0c
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/CVE-2016-9540.patch
@@ -0,0 +1,60 @@
1From 5ad9d8016fbb60109302d558f7edb2cb2a3bb8e3 Mon Sep 17 00:00:00 2001
2From: erouault <erouault>
3Date: Sat, 8 Oct 2016 15:54:56 +0000
4Subject: [PATCH] fix CVE-2016-9540
5 * tools/tiffcp.c: fix out-of-bounds write on tiled images with odd
6 tile width vs image width. Reported as MSVR 35103
7 by Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
8 Mitigations team.
9
10CVE: CVE-2016-9540
11
12Upstream-Status: Backport
13https://github.com/vadz/libtiff/commit/5ad9d8016fbb60109302d558f7edb2cb2a3bb8e3
14
15Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
16---
17 ChangeLog | 7 +++++++
18 tools/tiffcp.c | 4 ++--
19 2 files changed, 9 insertions(+), 2 deletions(-)
20
21Index: tiff-4.0.4/ChangeLog
22===================================================================
23--- tiff-4.0.4.orig/ChangeLog 2016-11-24 14:40:43.046867737 +0800
24+++ tiff-4.0.4/ChangeLog 2016-11-28 14:38:01.681276171 +0800
25@@ -17,6 +17,13 @@
26 Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2500
27 (CVE-2014-8127, duplicate: CVE-2016-3658)
28
29+2016-10-08 Even Rouault <even.rouault at spatialys.com>
30+
31+ * tools/tiffcp.c: fix out-of-bounds write on tiled images with odd
32+ tile width vs image width. Reported as MSVR 35103
33+ by Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
34+ Mitigations team.
35+
36 2016-09-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
37
38 * libtiff/tif_getimage.c (TIFFRGBAImageOK): Reject attempts to
39Index: tiff-4.0.4/tools/tiffcp.c
40===================================================================
41--- tiff-4.0.4.orig/tools/tiffcp.c 2015-06-21 09:09:10.000000000 +0800
42+++ tiff-4.0.4/tools/tiffcp.c 2016-11-28 14:41:02.221277430 +0800
43@@ -1338,7 +1338,7 @@
44 uint32 colb = 0;
45 uint32 col;
46
47- for (col = 0; col < imagewidth; col += tw) {
48+ for (col = 0; col < imagewidth && colb < imagew; col += tw) {
49 if (TIFFReadTile(in, tilebuf, col, row, 0, 0) < 0
50 && !ignore) {
51 TIFFError(TIFFFileName(in),
52@@ -1523,7 +1523,7 @@
53 uint32 colb = 0;
54 uint32 col;
55
56- for (col = 0; col < imagewidth; col += tw) {
57+ for (col = 0; col < imagewidth && colb < imagew; col += tw) {
58 /*
59 * Tile is clipped horizontally. Calculate
60 * visible portion and skewing factors.
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb b/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
index 9b4aff3..3057121 100644
--- a/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
+++ b/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
@@ -17,6 +17,7 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
17 file://CVE-2016-3622.patch \ 17 file://CVE-2016-3622.patch \
18 file://CVE-2016-3658.patch \ 18 file://CVE-2016-3658.patch \
19 file://CVE-2016-3632.patch \ 19 file://CVE-2016-3632.patch \
20 file://CVE-2016-9540.patch \
20 " 21 "
21 22
22SRC_URI[md5sum] = "d1d2e940dea0b5ad435f21f03d96dd72" 23SRC_URI[md5sum] = "d1d2e940dea0b5ad435f21f03d96dd72"