summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libtiff/files/CVE-2016-9539.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/libtiff/files/CVE-2016-9539.patch')
-rw-r--r--meta/recipes-multimedia/libtiff/files/CVE-2016-9539.patch60
1 files changed, 60 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 0000000000..1d9be423a7
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/CVE-2016-9539.patch
@@ -0,0 +1,60 @@
1From ae9365db1b271b62b35ce018eac8799b1d5e8a53 Mon Sep 17 00:00:00 2001
2From: erouault <erouault>
3Date: Fri, 14 Oct 2016 19:13:20 +0000
4Subject: [PATCH ] * tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes
5 in readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel Souchet
6 & Vishal Chauhan from the MSRC Vulnerabilities & Mitigations team.
7
8CVE: CVE-2016-9539
9
10Upstream-Status: Backport
11https://github.com/vadz/libtiff/commit/ae9365db1b271b62b35ce018eac8799b1d5e8a53
12
13Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
14
15---
16 ChangeLog | 6 ++++++
17 tools/tiffcrop.c | 11 ++++++++++-
18 2 files changed, 16 insertions(+), 1 deletion(-)
19
20Index: tiff-4.0.6/ChangeLog
21===================================================================
22--- tiff-4.0.6.orig/ChangeLog 2016-11-28 14:56:32.109283913 +0800
23+++ tiff-4.0.6/ChangeLog 2016-11-28 16:36:01.805325534 +0800
24@@ -17,6 +17,12 @@
25 Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2500
26 (CVE-2014-8127, duplicate: CVE-2016-3658)
27
28+2016-10-14 Even Rouault <even.rouault at spatialys.com>
29+
30+ * tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes in
31+ readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel Souchet
32+ & Vishal Chauhan from the MSRC Vulnerabilities & Mitigations team.
33+
34 2016-10-08 Even Rouault <even.rouault at spatialys.com>
35
36 * tools/tiffcp.c: fix out-of-bounds write on tiled images with odd
37Index: tiff-4.0.6/tools/tiffcrop.c
38===================================================================
39--- tiff-4.0.6.orig/tools/tiffcrop.c 2016-11-28 14:56:31.433283908 +0800
40+++ tiff-4.0.6/tools/tiffcrop.c 2016-11-28 16:42:13.793328128 +0800
41@@ -819,9 +819,18 @@
42 }
43 }
44
45- tilebuf = _TIFFmalloc(tile_buffsize);
46+ /* Add 3 padding bytes for extractContigSamplesShifted32bits */
47+ if( tile_buffsize > 0xFFFFFFFFU - 3 )
48+ {
49+ TIFFError("readContigTilesIntoBuffer", "Integer overflow when calculating buffer size.");
50+ exit(-1);
51+ }
52+ tilebuf = _TIFFmalloc(tile_buffsize + 3);
53 if (tilebuf == 0)
54 return 0;
55+ tilebuf[tile_buffsize] = 0;
56+ tilebuf[tile_buffsize+1] = 0;
57+ tilebuf[tile_buffsize+2] = 0;
58
59 dst_rowsize = ((imagewidth * bps * spp) + 7) / 8;
60 for (row = 0; row < imagelength; row += tl)