diff options
| author | Yi Zhao <yi.zhao@windriver.com> | 2017-08-22 08:58:35 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-09-11 22:15:58 +0100 |
| commit | f77fdc9f9f9c2665d3371ec129a45b4f603493d3 (patch) | |
| tree | 6ce5342c21406a207316931ef760846163f47e22 | |
| parent | cb4fd41504826905455a34d3cb85e952f4ed4991 (diff) | |
| download | poky-f77fdc9f9f9c2665d3371ec129a45b4f603493d3.tar.gz | |
tiff: Security fixes
Fix CVE-2017-9147, CVE-2017-9936, CVE-2017-10668, CVE-2017-11335
References:
https://nvd.nist.gov/vuln/detail/CVE-2017-9147
https://nvd.nist.gov/vuln/detail/CVE-2017-9936
https://nvd.nist.gov/vuln/detail/CVE-2017-10668
https://nvd.nist.gov/vuln/detail/CVE-2017-11335
Patches from:
CVE-2017-9147:
https://github.com/vadz/libtiff/commit/4d4fa0b68ae9ae038959ee4f69ebe288ec892f06
CVE-2017-9936:
https://github.com/vadz/libtiff/commit/fe8d7165956b88df4837034a9161dc5fd20cf67a
CVE-2017-10688:
https://github.com/vadz/libtiff/commit/6173a57d39e04d68b139f8c1aa499a24dbe74ba1
CVE-2017-11355:
https://github.com/vadz/libtiff/commit/69bfeec247899776b1b396651adb47436e5f1556
(From OE-Core rev: 5c89539edb17d01ffe82a1b2e7d092816003ecf3)
(From OE-Core rev: eaf72d105bed54e332e2e5c0c5c0a0087ecd91dd)
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
minor fixes to get to apply
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 files changed, 395 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2017-10688.patch b/meta/recipes-multimedia/libtiff/files/CVE-2017-10688.patch new file mode 100644 index 0000000000..ed9c0f50f9 --- /dev/null +++ b/meta/recipes-multimedia/libtiff/files/CVE-2017-10688.patch | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | From 333ba5599e87bd7747516d7863d61764e4ca2d92 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Even Rouault <even.rouault@spatialys.com> | ||
| 3 | Date: Fri, 30 Jun 2017 17:29:44 +0000 | ||
| 4 | Subject: [PATCH] * libtiff/tif_dirwrite.c: in | ||
| 5 | TIFFWriteDirectoryTagCheckedXXXX() functions associated with LONG8/SLONG8 | ||
| 6 | data type, replace assertion that the file is BigTIFF, by a non-fatal error. | ||
| 7 | Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2712 Reported by team | ||
| 8 | OWL337 | ||
| 9 | |||
| 10 | Upstream-Status: Backport | ||
| 11 | [https://github.com/vadz/libtiff/commit/6173a57d39e04d68b139f8c1aa499a24dbe74ba1] | ||
| 12 | |||
| 13 | CVE: CVE-2017-10688 | ||
| 14 | |||
| 15 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 16 | --- | ||
| 17 | ChangeLog | 8 ++++++++ | ||
| 18 | libtiff/tif_dirwrite.c | 20 ++++++++++++++++---- | ||
| 19 | 2 files changed, 24 insertions(+), 4 deletions(-) | ||
| 20 | |||
| 21 | Index: tiff-4.0.7/ChangeLog | ||
| 22 | =================================================================== | ||
| 23 | --- tiff-4.0.7.orig/ChangeLog | ||
| 24 | +++ tiff-4.0.7/ChangeLog | ||
| 25 | @@ -1,3 +1,11 @@ | ||
| 26 | +2017-06-30 Even Rouault <even.rouault at spatialys.com> | ||
| 27 | + | ||
| 28 | + * libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedXXXX() | ||
| 29 | + functions associated with LONG8/SLONG8 data type, replace assertion that | ||
| 30 | + the file is BigTIFF, by a non-fatal error. | ||
| 31 | + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2712 | ||
| 32 | + Reported by team OWL337 | ||
| 33 | + | ||
| 34 | 2017-06-26 Even Rouault <even.rouault at spatialys.com> | ||
| 35 | |||
| 36 | * libtiff/tif_jbig.c: fix memory leak in error code path of JBIGDecode() | ||
| 37 | Index: tiff-4.0.7/libtiff/tif_dirwrite.c | ||
| 38 | =================================================================== | ||
| 39 | --- tiff-4.0.7.orig/libtiff/tif_dirwrite.c | ||
| 40 | +++ tiff-4.0.7/libtiff/tif_dirwrite.c | ||
| 41 | @@ -2047,7 +2047,10 @@ TIFFWriteDirectoryTagCheckedLong8(TIFF* | ||
| 42 | { | ||
| 43 | uint64 m; | ||
| 44 | assert(sizeof(uint64)==8); | ||
| 45 | - assert(tif->tif_flags&TIFF_BIGTIFF); | ||
| 46 | + if( !(tif->tif_flags&TIFF_BIGTIFF) ) { | ||
| 47 | + TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","LONG8 not allowed for ClassicTIFF"); | ||
| 48 | + return(0); | ||
| 49 | + } | ||
| 50 | m=value; | ||
| 51 | if (tif->tif_flags&TIFF_SWAB) | ||
| 52 | TIFFSwabLong8(&m); | ||
| 53 | @@ -2060,7 +2063,10 @@ TIFFWriteDirectoryTagCheckedLong8Array(T | ||
| 54 | { | ||
| 55 | assert(count<0x20000000); | ||
| 56 | assert(sizeof(uint64)==8); | ||
| 57 | - assert(tif->tif_flags&TIFF_BIGTIFF); | ||
| 58 | + if( !(tif->tif_flags&TIFF_BIGTIFF) ) { | ||
| 59 | + TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","LONG8 not allowed for ClassicTIFF"); | ||
| 60 | + return(0); | ||
| 61 | + } | ||
| 62 | if (tif->tif_flags&TIFF_SWAB) | ||
| 63 | TIFFSwabArrayOfLong8(value,count); | ||
| 64 | return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG8,count,count*8,value)); | ||
| 65 | @@ -2072,7 +2078,10 @@ TIFFWriteDirectoryTagCheckedSlong8(TIFF* | ||
| 66 | { | ||
| 67 | int64 m; | ||
| 68 | assert(sizeof(int64)==8); | ||
| 69 | - assert(tif->tif_flags&TIFF_BIGTIFF); | ||
| 70 | + if( !(tif->tif_flags&TIFF_BIGTIFF) ) { | ||
| 71 | + TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","SLONG8 not allowed for ClassicTIFF"); | ||
| 72 | + return(0); | ||
| 73 | + } | ||
| 74 | m=value; | ||
| 75 | if (tif->tif_flags&TIFF_SWAB) | ||
| 76 | TIFFSwabLong8((uint64*)(&m)); | ||
| 77 | @@ -2085,7 +2094,10 @@ TIFFWriteDirectoryTagCheckedSlong8Array( | ||
| 78 | { | ||
| 79 | assert(count<0x20000000); | ||
| 80 | assert(sizeof(int64)==8); | ||
| 81 | - assert(tif->tif_flags&TIFF_BIGTIFF); | ||
| 82 | + if( !(tif->tif_flags&TIFF_BIGTIFF) ) { | ||
| 83 | + TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","SLONG8 not allowed for ClassicTIFF"); | ||
| 84 | + return(0); | ||
| 85 | + } | ||
| 86 | if (tif->tif_flags&TIFF_SWAB) | ||
| 87 | TIFFSwabArrayOfLong8((uint64*)value,count); | ||
| 88 | return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG8,count,count*8,value)); | ||
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2017-11335.patch b/meta/recipes-multimedia/libtiff/files/CVE-2017-11335.patch new file mode 100644 index 0000000000..d08e7612b7 --- /dev/null +++ b/meta/recipes-multimedia/libtiff/files/CVE-2017-11335.patch | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | From e8b15ccf8c9c593000f8202cf34cc6c4b936d01e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Even Rouault <even.rouault@spatialys.com> | ||
| 3 | Date: Sat, 15 Jul 2017 11:13:46 +0000 | ||
| 4 | Subject: [PATCH] * tools/tiff2pdf.c: prevent heap buffer overflow write in | ||
| 5 | "Raw" mode on PlanarConfig=Contig input images. Fixes | ||
| 6 | http://bugzilla.maptools.org/show_bug.cgi?id=2715 Reported by team OWL337 | ||
| 7 | |||
| 8 | Upstream-Status: Backport | ||
| 9 | [https://github.com/vadz/libtiff/commit/69bfeec247899776b1b396651adb47436e5f1556] | ||
| 10 | |||
| 11 | CVE: CVE-2017-11355 | ||
| 12 | |||
| 13 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 14 | --- | ||
| 15 | ChangeLog | 7 +++++++ | ||
| 16 | tools/tiff2pdf.c | 7 ++++++- | ||
| 17 | 2 files changed, 13 insertions(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/ChangeLog b/ChangeLog | ||
| 20 | index 42eaeb7..6980da8 100644 | ||
| 21 | --- a/ChangeLog | ||
| 22 | +++ b/ChangeLog | ||
| 23 | @@ -1,3 +1,10 @@ | ||
| 24 | +2017-07-15 Even Rouault <even.rouault at spatialys.com> | ||
| 25 | + | ||
| 26 | + * tools/tiff2pdf.c: prevent heap buffer overflow write in "Raw" | ||
| 27 | + mode on PlanarConfig=Contig input images. | ||
| 28 | + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2715 | ||
| 29 | + Reported by team OWL337 | ||
| 30 | + | ||
| 31 | 2017-06-30 Even Rouault <even.rouault at spatialys.com> | ||
| 32 | |||
| 33 | * libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedXXXX() | ||
| 34 | diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c | ||
| 35 | index db196e0..cd1e235 100644 | ||
| 36 | --- a/tools/tiff2pdf.c | ||
| 37 | +++ b/tools/tiff2pdf.c | ||
| 38 | @@ -1737,7 +1737,12 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){ | ||
| 39 | return; | ||
| 40 | |||
| 41 | t2p->pdf_transcode = T2P_TRANSCODE_ENCODE; | ||
| 42 | - if(t2p->pdf_nopassthrough==0){ | ||
| 43 | + /* It seems that T2P_TRANSCODE_RAW mode doesn't support separate->contig */ | ||
| 44 | + /* conversion. At least t2p_read_tiff_size and t2p_read_tiff_size_tile */ | ||
| 45 | + /* do not take into account the number of samples, and thus */ | ||
| 46 | + /* that can cause heap buffer overflows such as in */ | ||
| 47 | + /* http://bugzilla.maptools.org/show_bug.cgi?id=2715 */ | ||
| 48 | + if(t2p->pdf_nopassthrough==0 && t2p->tiff_planar!=PLANARCONFIG_SEPARATE){ | ||
| 49 | #ifdef CCITT_SUPPORT | ||
| 50 | if(t2p->tiff_compression==COMPRESSION_CCITTFAX4 | ||
| 51 | ){ | ||
| 52 | -- | ||
| 53 | 2.7.4 | ||
| 54 | |||
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2017-9147.patch b/meta/recipes-multimedia/libtiff/files/CVE-2017-9147.patch new file mode 100644 index 0000000000..94f33900a5 --- /dev/null +++ b/meta/recipes-multimedia/libtiff/files/CVE-2017-9147.patch | |||
| @@ -0,0 +1,203 @@ | |||
| 1 | From 0acf01fea714af573b814e10cf105c3359a236c3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: erouault <erouault> | ||
| 3 | Date: Thu, 1 Jun 2017 12:44:04 +0000 | ||
| 4 | Subject: [PATCH] * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(), | ||
| 5 | and use it in TIFFReadDirectory() so as to ignore fields whose tag is a | ||
| 6 | codec-specified tag but this codec is not enabled. This avoids TIFFGetField() | ||
| 7 | to behave differently depending on whether the codec is enabled or not, and | ||
| 8 | thus can avoid stack based buffer overflows in a number of TIFF utilities | ||
| 9 | such as tiffsplit, tiffcmp, thumbnail, etc. | ||
| 10 | Patch derived from 0063-Handle-properly-CODEC-specific-tags.patch | ||
| 11 | (http://bugzilla.maptools.org/show_bug.cgi?id=2580) by Raphaël Hertzog. | ||
| 12 | Fixes: | ||
| 13 | http://bugzilla.maptools.org/show_bug.cgi?id=2580 | ||
| 14 | http://bugzilla.maptools.org/show_bug.cgi?id=2693 | ||
| 15 | http://bugzilla.maptools.org/show_bug.cgi?id=2625 (CVE-2016-10095) | ||
| 16 | http://bugzilla.maptools.org/show_bug.cgi?id=2564 (CVE-2015-7554) | ||
| 17 | http://bugzilla.maptools.org/show_bug.cgi?id=2561 (CVE-2016-5318) | ||
| 18 | http://bugzilla.maptools.org/show_bug.cgi?id=2499 (CVE-2014-8128) | ||
| 19 | http://bugzilla.maptools.org/show_bug.cgi?id=2441 | ||
| 20 | http://bugzilla.maptools.org/show_bug.cgi?id=2433 | ||
| 21 | |||
| 22 | Upstream-Status: Backport | ||
| 23 | [https://github.com/vadz/libtiff/commit/4d4fa0b68ae9ae038959ee4f69ebe288ec892f06] | ||
| 24 | |||
| 25 | CVE: CVE-2017-9147 | ||
| 26 | |||
| 27 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 28 | --- | ||
| 29 | ChangeLog | 20 ++++++++++ | ||
| 30 | libtiff/tif_dir.h | 1 + | ||
| 31 | libtiff/tif_dirinfo.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
| 32 | libtiff/tif_dirread.c | 4 ++ | ||
| 33 | 4 files changed, 128 insertions(+) | ||
| 34 | |||
| 35 | Index: tiff-4.0.7/ChangeLog | ||
| 36 | =================================================================== | ||
| 37 | --- tiff-4.0.7.orig/ChangeLog | ||
| 38 | +++ tiff-4.0.7/ChangeLog | ||
| 39 | @@ -1,3 +1,23 @@ | ||
| 40 | +2017-06-01 Even Rouault <even.rouault at spatialys.com> | ||
| 41 | + | ||
| 42 | + * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(), | ||
| 43 | + and use it in TIFFReadDirectory() so as to ignore fields whose tag is a | ||
| 44 | + codec-specified tag but this codec is not enabled. This avoids TIFFGetField() | ||
| 45 | + to behave differently depending on whether the codec is enabled or not, and | ||
| 46 | + thus can avoid stack based buffer overflows in a number of TIFF utilities | ||
| 47 | + such as tiffsplit, tiffcmp, thumbnail, etc. | ||
| 48 | + Patch derived from 0063-Handle-properly-CODEC-specific-tags.patch | ||
| 49 | + (http://bugzilla.maptools.org/show_bug.cgi?id=2580) by Raphaël Hertzog. | ||
| 50 | + Fixes: | ||
| 51 | + http://bugzilla.maptools.org/show_bug.cgi?id=2580 | ||
| 52 | + http://bugzilla.maptools.org/show_bug.cgi?id=2693 | ||
| 53 | + http://bugzilla.maptools.org/show_bug.cgi?id=2625 (CVE-2016-10095) | ||
| 54 | + http://bugzilla.maptools.org/show_bug.cgi?id=2564 (CVE-2015-7554) | ||
| 55 | + http://bugzilla.maptools.org/show_bug.cgi?id=2561 (CVE-2016-5318) | ||
| 56 | + http://bugzilla.maptools.org/show_bug.cgi?id=2499 (CVE-2014-8128) | ||
| 57 | + http://bugzilla.maptools.org/show_bug.cgi?id=2441 | ||
| 58 | + http://bugzilla.maptools.org/show_bug.cgi?id=2433 | ||
| 59 | + | ||
| 60 | 2017-01-11 Even Rouault <even.rouault at spatialys.com> | ||
| 61 | |||
| 62 | * tools/tiffcp.c: error out cleanly in cpContig2SeparateByRow and | ||
| 63 | Index: tiff-4.0.7/libtiff/tif_dir.h | ||
| 64 | =================================================================== | ||
| 65 | --- tiff-4.0.7.orig/libtiff/tif_dir.h | ||
| 66 | +++ tiff-4.0.7/libtiff/tif_dir.h | ||
| 67 | @@ -291,6 +291,7 @@ struct _TIFFField { | ||
| 68 | extern int _TIFFMergeFields(TIFF*, const TIFFField[], uint32); | ||
| 69 | extern const TIFFField* _TIFFFindOrRegisterField(TIFF *, uint32, TIFFDataType); | ||
| 70 | extern TIFFField* _TIFFCreateAnonField(TIFF *, uint32, TIFFDataType); | ||
| 71 | +extern int _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag); | ||
| 72 | |||
| 73 | #if defined(__cplusplus) | ||
| 74 | } | ||
| 75 | Index: tiff-4.0.7/libtiff/tif_dirinfo.c | ||
| 76 | =================================================================== | ||
| 77 | --- tiff-4.0.7.orig/libtiff/tif_dirinfo.c | ||
| 78 | +++ tiff-4.0.7/libtiff/tif_dirinfo.c | ||
| 79 | @@ -956,6 +956,109 @@ TIFFMergeFieldInfo(TIFF* tif, const TIFF | ||
| 80 | return 0; | ||
| 81 | } | ||
| 82 | |||
| 83 | +int | ||
| 84 | +_TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag) | ||
| 85 | +{ | ||
| 86 | + /* Filter out non-codec specific tags */ | ||
| 87 | + switch (tag) { | ||
| 88 | + /* Shared tags */ | ||
| 89 | + case TIFFTAG_PREDICTOR: | ||
| 90 | + /* JPEG tags */ | ||
| 91 | + case TIFFTAG_JPEGTABLES: | ||
| 92 | + /* OJPEG tags */ | ||
| 93 | + case TIFFTAG_JPEGIFOFFSET: | ||
| 94 | + case TIFFTAG_JPEGIFBYTECOUNT: | ||
| 95 | + case TIFFTAG_JPEGQTABLES: | ||
| 96 | + case TIFFTAG_JPEGDCTABLES: | ||
| 97 | + case TIFFTAG_JPEGACTABLES: | ||
| 98 | + case TIFFTAG_JPEGPROC: | ||
| 99 | + case TIFFTAG_JPEGRESTARTINTERVAL: | ||
| 100 | + /* CCITT* */ | ||
| 101 | + case TIFFTAG_BADFAXLINES: | ||
| 102 | + case TIFFTAG_CLEANFAXDATA: | ||
| 103 | + case TIFFTAG_CONSECUTIVEBADFAXLINES: | ||
| 104 | + case TIFFTAG_GROUP3OPTIONS: | ||
| 105 | + case TIFFTAG_GROUP4OPTIONS: | ||
| 106 | + break; | ||
| 107 | + default: | ||
| 108 | + return 1; | ||
| 109 | + } | ||
| 110 | + /* Check if codec specific tags are allowed for the current | ||
| 111 | + * compression scheme (codec) */ | ||
| 112 | + switch (tif->tif_dir.td_compression) { | ||
| 113 | + case COMPRESSION_LZW: | ||
| 114 | + if (tag == TIFFTAG_PREDICTOR) | ||
| 115 | + return 1; | ||
| 116 | + break; | ||
| 117 | + case COMPRESSION_PACKBITS: | ||
| 118 | + /* No codec-specific tags */ | ||
| 119 | + break; | ||
| 120 | + case COMPRESSION_THUNDERSCAN: | ||
| 121 | + /* No codec-specific tags */ | ||
| 122 | + break; | ||
| 123 | + case COMPRESSION_NEXT: | ||
| 124 | + /* No codec-specific tags */ | ||
| 125 | + break; | ||
| 126 | + case COMPRESSION_JPEG: | ||
| 127 | + if (tag == TIFFTAG_JPEGTABLES) | ||
| 128 | + return 1; | ||
| 129 | + break; | ||
| 130 | + case COMPRESSION_OJPEG: | ||
| 131 | + switch (tag) { | ||
| 132 | + case TIFFTAG_JPEGIFOFFSET: | ||
| 133 | + case TIFFTAG_JPEGIFBYTECOUNT: | ||
| 134 | + case TIFFTAG_JPEGQTABLES: | ||
| 135 | + case TIFFTAG_JPEGDCTABLES: | ||
| 136 | + case TIFFTAG_JPEGACTABLES: | ||
| 137 | + case TIFFTAG_JPEGPROC: | ||
| 138 | + case TIFFTAG_JPEGRESTARTINTERVAL: | ||
| 139 | + return 1; | ||
| 140 | + } | ||
| 141 | + break; | ||
| 142 | + case COMPRESSION_CCITTRLE: | ||
| 143 | + case COMPRESSION_CCITTRLEW: | ||
| 144 | + case COMPRESSION_CCITTFAX3: | ||
| 145 | + case COMPRESSION_CCITTFAX4: | ||
| 146 | + switch (tag) { | ||
| 147 | + case TIFFTAG_BADFAXLINES: | ||
| 148 | + case TIFFTAG_CLEANFAXDATA: | ||
| 149 | + case TIFFTAG_CONSECUTIVEBADFAXLINES: | ||
| 150 | + return 1; | ||
| 151 | + case TIFFTAG_GROUP3OPTIONS: | ||
| 152 | + if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX3) | ||
| 153 | + return 1; | ||
| 154 | + break; | ||
| 155 | + case TIFFTAG_GROUP4OPTIONS: | ||
| 156 | + if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4) | ||
| 157 | + return 1; | ||
| 158 | + break; | ||
| 159 | + } | ||
| 160 | + break; | ||
| 161 | + case COMPRESSION_JBIG: | ||
| 162 | + /* No codec-specific tags */ | ||
| 163 | + break; | ||
| 164 | + case COMPRESSION_DEFLATE: | ||
| 165 | + case COMPRESSION_ADOBE_DEFLATE: | ||
| 166 | + if (tag == TIFFTAG_PREDICTOR) | ||
| 167 | + return 1; | ||
| 168 | + break; | ||
| 169 | + case COMPRESSION_PIXARLOG: | ||
| 170 | + if (tag == TIFFTAG_PREDICTOR) | ||
| 171 | + return 1; | ||
| 172 | + break; | ||
| 173 | + case COMPRESSION_SGILOG: | ||
| 174 | + case COMPRESSION_SGILOG24: | ||
| 175 | + /* No codec-specific tags */ | ||
| 176 | + break; | ||
| 177 | + case COMPRESSION_LZMA: | ||
| 178 | + if (tag == TIFFTAG_PREDICTOR) | ||
| 179 | + return 1; | ||
| 180 | + break; | ||
| 181 | + | ||
| 182 | + } | ||
| 183 | + return 0; | ||
| 184 | +} | ||
| 185 | + | ||
| 186 | /* vim: set ts=8 sts=8 sw=8 noet: */ | ||
| 187 | |||
| 188 | /* | ||
| 189 | Index: tiff-4.0.7/libtiff/tif_dirread.c | ||
| 190 | =================================================================== | ||
| 191 | --- tiff-4.0.7.orig/libtiff/tif_dirread.c | ||
| 192 | +++ tiff-4.0.7/libtiff/tif_dirread.c | ||
| 193 | @@ -3566,6 +3566,10 @@ TIFFReadDirectory(TIFF* tif) | ||
| 194 | goto bad; | ||
| 195 | dp->tdir_tag=IGNORE; | ||
| 196 | break; | ||
| 197 | + default: | ||
| 198 | + if( !_TIFFCheckFieldIsValidForCodec(tif, dp->tdir_tag) ) | ||
| 199 | + dp->tdir_tag=IGNORE; | ||
| 200 | + break; | ||
| 201 | } | ||
| 202 | } | ||
| 203 | } | ||
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2017-9936.patch b/meta/recipes-multimedia/libtiff/files/CVE-2017-9936.patch new file mode 100644 index 0000000000..204949bfc6 --- /dev/null +++ b/meta/recipes-multimedia/libtiff/files/CVE-2017-9936.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From 62efea76592647426deec5592fd7274d5c950646 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Even Rouault <even.rouault@spatialys.com> | ||
| 3 | Date: Mon, 26 Jun 2017 15:19:59 +0000 | ||
| 4 | Subject: [PATCH] * libtiff/tif_jbig.c: fix memory leak in error code path of | ||
| 5 | JBIGDecode() Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2706 Reported | ||
| 6 | by team OWL337 | ||
| 7 | |||
| 8 | * libtiff/tif_jpeg.c: error out at decoding time if anticipated libjpeg | ||
| 9 | |||
| 10 | Upstream-Status: Backport | ||
| 11 | [https://github.com/vadz/libtiff/commit/fe8d7165956b88df4837034a9161dc5fd20cf67a] | ||
| 12 | |||
| 13 | CVE: CVE-2017-9936 | ||
| 14 | |||
| 15 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 16 | --- | ||
| 17 | ChangeLog | 6 ++++++ | ||
| 18 | libtiff/tif_jbig.c | 1 + | ||
| 19 | 2 files changed, 7 insertions(+) | ||
| 20 | |||
| 21 | Index: tiff-4.0.7/ChangeLog | ||
| 22 | =================================================================== | ||
| 23 | --- tiff-4.0.7.orig/ChangeLog | ||
| 24 | +++ tiff-4.0.7/ChangeLog | ||
| 25 | @@ -1,3 +1,9 @@ | ||
| 26 | +2017-06-26 Even Rouault <even.rouault at spatialys.com> | ||
| 27 | + | ||
| 28 | + * libtiff/tif_jbig.c: fix memory leak in error code path of JBIGDecode() | ||
| 29 | + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2706 | ||
| 30 | + Reported by team OWL337 | ||
| 31 | + | ||
| 32 | 2017-06-01 Even Rouault <even.rouault at spatialys.com> | ||
| 33 | |||
| 34 | * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(), | ||
| 35 | Index: tiff-4.0.7/libtiff/tif_jbig.c | ||
| 36 | =================================================================== | ||
| 37 | --- tiff-4.0.7.orig/libtiff/tif_jbig.c | ||
| 38 | +++ tiff-4.0.7/libtiff/tif_jbig.c | ||
| 39 | @@ -94,6 +94,7 @@ static int JBIGDecode(TIFF* tif, uint8* | ||
| 40 | jbg_strerror(decodeStatus) | ||
| 41 | #endif | ||
| 42 | ); | ||
| 43 | + jbg_dec_free(&decoder); | ||
| 44 | return 0; | ||
| 45 | } | ||
| 46 | |||
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb b/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb index e58173604e..e60cbb564f 100644 --- a/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb +++ b/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb | |||
| @@ -7,6 +7,10 @@ CVE_PRODUCT = "libtiff" | |||
| 7 | SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \ | 7 | SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \ |
| 8 | file://libtool2.patch \ | 8 | file://libtool2.patch \ |
| 9 | file://libtiff-CVE-2017-5225.patch \ | 9 | file://libtiff-CVE-2017-5225.patch \ |
| 10 | file://CVE-2017-9147.patch \ | ||
| 11 | file://CVE-2017-9936.patch \ | ||
| 12 | file://CVE-2017-10688.patch \ | ||
| 13 | file://CVE-2017-11335.patch \ | ||
| 10 | " | 14 | " |
| 11 | 15 | ||
| 12 | SRC_URI[md5sum] = "77ae928d2c6b7fb46a21c3a29325157b" | 16 | SRC_URI[md5sum] = "77ae928d2c6b7fb46a21c3a29325157b" |
