diff options
author | Mingli Yu <Mingli.Yu@windriver.com> | 2016-12-07 16:01:12 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-08 10:31:29 +0000 |
commit | b229874a8821ebbb0e5a25d2b9e5295d2df44cd8 (patch) | |
tree | eb707b701df66754b693c4c6ac2e44caadc4c098 /meta/recipes-multimedia | |
parent | 799e8b124fe9f06cbab44c17e51bdc72c6535d53 (diff) | |
download | poky-b229874a8821ebbb0e5a25d2b9e5295d2df44cd8.tar.gz |
tiff: Security fix CVE-2016-9538
* tools/tiffcrop.c: fix read of undefined buffer in
readContigStripsIntoBuffer() due to uint16 overflow.
External References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-9538
Patch from:
https://github.com/vadz/libtiff/commit/43c0b81a818640429317c80fea1e66771e85024b#diff-c8b4b355f9b5c06d585b23138e1c185f
(From OE-Core rev: 9af5d5ea882c853e4cb15006f990d3814eeea9ae)
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia')
-rw-r--r-- | meta/recipes-multimedia/libtiff/files/CVE-2016-9538.patch | 67 | ||||
-rw-r--r-- | meta/recipes-multimedia/libtiff/tiff_4.0.6.bb | 1 |
2 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2016-9538.patch b/meta/recipes-multimedia/libtiff/files/CVE-2016-9538.patch new file mode 100644 index 0000000000..e1141dfb69 --- /dev/null +++ b/meta/recipes-multimedia/libtiff/files/CVE-2016-9538.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From 43c0b81a818640429317c80fea1e66771e85024b Mon Sep 17 00:00:00 2001 | ||
2 | From: erouault <erouault> | ||
3 | Date: Sat, 8 Oct 2016 15:04:31 +0000 | ||
4 | Subject: [PATCH] Fix CVE-2016-9538 | ||
5 | * tools/tiffcp.c: fix read of undefined variable in case of | ||
6 | missing required tags. Found on test case of MSVR 35100. * tools/tiffcrop.c: | ||
7 | fix read of undefined buffer in readContigStripsIntoBuffer() due to uint16 | ||
8 | overflow. Probably not a security issue but I can be wrong. Reported as MSVR | ||
9 | 35100 by Axel Souchet from the MSRC Vulnerabilities & Mitigations team. | ||
10 | |||
11 | CVE: CVE-2016-9538 | ||
12 | Upstream-Status: Backport | ||
13 | https://github.com/vadz/libtiff/commit/43c0b81a818640429317c80fea1e66771e85024b#diff-c8b4b355f9b5c06d585b23138e1c185f | ||
14 | |||
15 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | ||
16 | |||
17 | --- | ||
18 | tools/tiffcp.c | 4 ++-- | ||
19 | tools/tiffcrop.c | 9 ++++++--- | ||
20 | 2 files changed, 17 insertions(+), 5 deletions(-) | ||
21 | |||
22 | diff --git a/tools/tiffcp.c b/tools/tiffcp.c | ||
23 | index ba2b715..4ad74d3 100644 | ||
24 | --- a/tools/tiffcp.c | ||
25 | +++ b/tools/tiffcp.c | ||
26 | @@ -592,8 +592,8 @@ static copyFunc pickCopyFunc(TIFF*, TIFF*, uint16, uint16); | ||
27 | static int | ||
28 | tiffcp(TIFF* in, TIFF* out) | ||
29 | { | ||
30 | - uint16 bitspersample, samplesperpixel; | ||
31 | - uint16 input_compression, input_photometric; | ||
32 | + uint16 bitspersample, samplesperpixel = 1; | ||
33 | + uint16 input_compression, input_photometric = PHOTOMETRIC_MINISBLACK; | ||
34 | copyFunc cf; | ||
35 | uint32 width, length; | ||
36 | struct cpTag* p; | ||
37 | diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c | ||
38 | index 7685566..eb6de77 100644 | ||
39 | --- a/tools/tiffcrop.c | ||
40 | +++ b/tools/tiffcrop.c | ||
41 | @@ -3628,7 +3628,7 @@ static int readContigStripsIntoBuffer (TIFF* in, uint8* buf) | ||
42 | { | ||
43 | uint8* bufp = buf; | ||
44 | int32 bytes_read = 0; | ||
45 | - uint16 strip, nstrips = TIFFNumberOfStrips(in); | ||
46 | + uint32 strip, nstrips = TIFFNumberOfStrips(in); | ||
47 | uint32 stripsize = TIFFStripSize(in); | ||
48 | uint32 rows = 0; | ||
49 | uint32 rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps); | ||
50 | @@ -4711,9 +4711,12 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length, | ||
51 | uint32 width, uint16 spp, | ||
52 | struct dump_opts *dump) | ||
53 | { | ||
54 | - int i, j, bytes_per_sample, bytes_per_pixel, shift_width, result = 1; | ||
55 | + int i, bytes_per_sample, bytes_per_pixel, shift_width, result = 1; | ||
56 | + uint32 j; | ||
57 | int32 bytes_read = 0; | ||
58 | - uint16 bps, nstrips, planar, strips_per_sample; | ||
59 | + uint16 bps, planar; | ||
60 | + uint32 nstrips; | ||
61 | + uint32 strips_per_sample; | ||
62 | uint32 src_rowsize, dst_rowsize, rows_processed, rps; | ||
63 | uint32 rows_this_strip = 0; | ||
64 | tsample_t s; | ||
65 | -- | ||
66 | 2.9.3 | ||
67 | |||
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb b/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb index 6495d1fad5..e0f91b8390 100644 --- a/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb +++ b/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb | |||
@@ -23,6 +23,7 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \ | |||
23 | file://CVE-2016-9539.patch \ | 23 | file://CVE-2016-9539.patch \ |
24 | file://CVE-2016-9535-1.patch \ | 24 | file://CVE-2016-9535-1.patch \ |
25 | file://CVE-2016-9535-2.patch \ | 25 | file://CVE-2016-9535-2.patch \ |
26 | file://CVE-2016-9538.patch \ | ||
26 | " | 27 | " |
27 | 28 | ||
28 | SRC_URI[md5sum] = "d1d2e940dea0b5ad435f21f03d96dd72" | 29 | SRC_URI[md5sum] = "d1d2e940dea0b5ad435f21f03d96dd72" |