summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2016-08-10 15:11:17 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-23 15:27:04 +0100
commit2b029e56f93a48074ca798c6f07f31115e4160a1 (patch)
treec9f1d903850fc5418969b7e1f59d0223dca0f0b8
parentb6f4d24fbc405da02c7814338600e2e44e47186a (diff)
downloadpoky-2b029e56f93a48074ca798c6f07f31115e4160a1.tar.gz
tiff: Security fix CVE-2015-8784
CVE-2015-8784 libtiff: out-of-bound write in NeXTDecode() External Reference: https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8784 (From OE-Core rev: 36097da9679ab2ce3c4044cd8ed64e5577e3f63e) (From OE-Core rev: a1839427c5626367beb6bf59d900904dedb6bf03) Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Yi Zhao <yi.zhao@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>
-rw-r--r--meta/recipes-multimedia/libtiff/files/CVE-2015-8784.patch73
-rw-r--r--meta/recipes-multimedia/libtiff/tiff_4.0.6.bb1
2 files changed, 74 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2015-8784.patch b/meta/recipes-multimedia/libtiff/files/CVE-2015-8784.patch
new file mode 100644
index 0000000000..0caf800e23
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/CVE-2015-8784.patch
@@ -0,0 +1,73 @@
1From b18012dae552f85dcc5c57d3bf4e997a15b1cc1c Mon Sep 17 00:00:00 2001
2From: erouault <erouault>
3Date: Sun, 27 Dec 2015 16:55:20 +0000
4Subject: [PATCH] * libtiff/tif_next.c: fix potential out-of-bound write in
5 NeXTDecode() triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
6 (bugzilla #2508)
7
8Upstream-Status: Backport
9https://github.com/vadz/libtiff/commit/b18012dae552f85dcc5c57d3bf4e997a15b1cc1c
10hand applied Changelog changes
11
12CVE: CVE-2015-8784
13Signed-off-by: Armin Kuster <akuster@mvista.com>
14
15---
16 ChangeLog | 6 ++++++
17 libtiff/tif_next.c | 10 ++++++++--
18 2 files changed, 14 insertions(+), 2 deletions(-)
19
20Index: tiff-4.0.4/ChangeLog
21===================================================================
22--- tiff-4.0.4.orig/ChangeLog
23+++ tiff-4.0.4/ChangeLog
24@@ -1,5 +1,11 @@
25 2015-12-27 Even Rouault <even.rouault at spatialys.com>
26
27+ * libtiff/tif_next.c: fix potential out-of-bound write in NeXTDecode()
28+ triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
29+ (bugzilla #2508)
30+
31+2015-12-27 Even Rouault <even.rouault at spatialys.com>
32+
33 * libtiff/tif_luv.c: fix potential out-of-bound writes in decode
34 functions in non debug builds by replacing assert()s by regular if
35 checks (bugzilla #2522).
36Index: tiff-4.0.4/libtiff/tif_next.c
37===================================================================
38--- tiff-4.0.4.orig/libtiff/tif_next.c
39+++ tiff-4.0.4/libtiff/tif_next.c
40@@ -37,7 +37,7 @@
41 case 0: op[0] = (unsigned char) ((v) << 6); break; \
42 case 1: op[0] |= (v) << 4; break; \
43 case 2: op[0] |= (v) << 2; break; \
44- case 3: *op++ |= (v); break; \
45+ case 3: *op++ |= (v); op_offset++; break; \
46 } \
47 }
48
49@@ -106,6 +106,7 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize
50 uint32 imagewidth = tif->tif_dir.td_imagewidth;
51 if( isTiled(tif) )
52 imagewidth = tif->tif_dir.td_tilewidth;
53+ tmsize_t op_offset = 0;
54
55 /*
56 * The scanline is composed of a sequence of constant
57@@ -122,10 +123,15 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize
58 * bounds, potentially resulting in a security
59 * issue.
60 */
61- while (n-- > 0 && npixels < imagewidth)
62+ while (n-- > 0 && npixels < imagewidth && op_offset < scanline)
63 SETPIXEL(op, grey);
64 if (npixels >= imagewidth)
65 break;
66+ if (op_offset >= scanline ) {
67+ TIFFErrorExt(tif->tif_clientdata, module, "Invalid data for scanline %ld",
68+ (long) tif->tif_row);
69+ return (0);
70+ }
71 if (cc == 0)
72 goto bad;
73 n = *bp++, cc--;
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb b/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
index 9879c8bfab..05064753eb 100644
--- a/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
+++ b/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
@@ -7,6 +7,7 @@ SRC_URI = "ftp://ftp.remotesensing.org/pub/libtiff/tiff-${PV}.tar.gz \
7 file://libtool2.patch \ 7 file://libtool2.patch \
8 file://CVE-2015-8665_8683.patch \ 8 file://CVE-2015-8665_8683.patch \
9 file://CVE-2015-8781.patch \ 9 file://CVE-2015-8781.patch \
10 file://CVE-2015-8784.patch \
10 " 11 "
11 12
12SRC_URI[md5sum] = "d1d2e940dea0b5ad435f21f03d96dd72" 13SRC_URI[md5sum] = "d1d2e940dea0b5ad435f21f03d96dd72"