aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2016-01-29 17:39:37 -0800
committerJoshua Lock <joshua.g.lock@intel.com>2016-02-29 15:05:16 +0000
commit645255274769bfaeb737f66a6222a9a929823160 (patch)
tree751e4579f6b4079997a7d36c48927f358867f683
parentfa7fac56be40fdb519d426e9465436415e3f5527 (diff)
downloadopenembedded-core-contrib-645255274769bfaeb737f66a6222a9a929823160.tar.gz
tiff: Security fix CVE-2015-8784
CVE-2015-8784 libtiff: out-of-bound write in NeXTDecode() (From OE-Core master rev: 3e89477c8ad980fabd13694fa72a0be2e354bbe2) minor tweak to get tif_next.c changes to apply. Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
-rw-r--r--meta/recipes-multimedia/libtiff/files/CVE-2015-8784.patch73
-rw-r--r--meta/recipes-multimedia/libtiff/tiff_4.0.3.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..91626bca9b
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/CVE-2015-8784.patch
@@ -0,0 +1,73 @@
+From b18012dae552f85dcc5c57d3bf4e997a15b1cc1c Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Sun, 27 Dec 2015 16:55:20 +0000
+Subject: [PATCH] * libtiff/tif_next.c: fix potential out-of-bound write in
+ NeXTDecode() triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
+ (bugzilla #2508)
+
+Upstream-Status: Backport
+https://github.com/vadz/libtiff/commit/b18012dae552f85dcc5c57d3bf4e997a15b1cc1c
+hand applied Changelog changes
+
+CVE: CVE-2015-8784
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ ChangeLog | 6 ++++++
+ libtiff/tif_next.c | 10 ++++++++--
+ 2 files changed, 14 insertions(+), 2 deletions(-)
+
+Index: tiff-4.0.3/ChangeLog
+===================================================================
+--- tiff-4.0.3.orig/ChangeLog
++++ tiff-4.0.3/ChangeLog
+@@ -1,5 +1,11 @@
+ 2015-12-27 Even Rouault <even.rouault at spatialys.com>
+
++ * libtiff/tif_next.c: fix potential out-of-bound write in NeXTDecode()
++ triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
++ (bugzilla #2508)
++
++2015-12-27 Even Rouault <even.rouault at spatialys.com>
++
+ * libtiff/tif_luv.c: fix potential out-of-bound writes in decode
+ functions in non debug builds by replacing assert()s by regular if
+ checks (bugzilla #2522).
+Index: tiff-4.0.3/libtiff/tif_next.c
+===================================================================
+--- tiff-4.0.3.orig/libtiff/tif_next.c
++++ tiff-4.0.3/libtiff/tif_next.c
+@@ -37,7 +37,7 @@
+ case 0: op[0] = (unsigned char) ((v) << 6); break; \
+ case 1: op[0] |= (v) << 4; break; \
+ case 2: op[0] |= (v) << 2; break; \
+- case 3: *op++ |= (v); break; \
++ case 3: *op++ |= (v); op_offset++; break; \
+ } \
+ }
+
+@@ -102,6 +102,7 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize
+ default: {
+ uint32 npixels = 0, grey;
+ uint32 imagewidth = tif->tif_dir.td_imagewidth;
++ tmsize_t op_offset = 0;
+
+ /*
+ * The scanline is composed of a sequence of constant
+@@ -118,10 +119,15 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize
+ * bounds, potentially resulting in a security
+ * issue.
+ */
+- while (n-- > 0 && npixels < imagewidth)
++ while (n-- > 0 && npixels < imagewidth && op_offset < scanline)
+ SETPIXEL(op, grey);
+ if (npixels >= imagewidth)
+ break;
++ if (op_offset >= scanline ) {
++ TIFFErrorExt(tif->tif_clientdata, module, "Invalid data for scanline %ld",
++ (long) tif->tif_row);
++ return (0);
++ }
+ if (cc == 0)
+ goto bad;
+ n = *bp++, cc--;
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.0.3.bb b/meta/recipes-multimedia/libtiff/tiff_4.0.3.bb
index 070065b188..a16fd23e23 100644
--- a/meta/recipes-multimedia/libtiff/tiff_4.0.3.bb
+++ b/meta/recipes-multimedia/libtiff/tiff_4.0.3.bb
@@ -13,6 +13,7 @@ SRC_URI = "ftp://ftp.remotesensing.org/pub/libtiff/tiff-${PV}.tar.gz \
file://libtiff-CVE-2013-4231.patch \
file://tiff-CVE-2012-4564.patch \
file://CVE-2015-8781.patch \
+ file://CVE-2015-8784.patch \
"
SRC_URI[md5sum] = "051c1068e6a0627f461948c365290410"