From d5ec5ed7197d121130af6953378bcfd8929a9754 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 3 Jul 2017 12:07:23 +0200 Subject: packages: Mark 'replacement' as an "innate" field. Suggested by Mark H Weaver at . * guix/packages.scm ()[replacement]: Mark as "innate". * gnu/packages/base.scm (glibc-2.25-patched, glibc-2.24) (glibc-2.23, glibc-2.22, glibc-2.21, glibc-locales): Remove 'replacement' field, which was set to #f. * gnu/packages/commencement.scm (perl-boot0): Likewise. * gnu/packages/fontutils.scm (graphite2/fixed): Likewise. * gnu/packages/ghostscript.scm (ghostscript/fixed): Likewise. * gnu/packages/gnupg.scm (libgcrypt-1.7.8): Likewise. * gnu/packages/guile.scm (guile-2.0/fixed, guile-2.2): Likewise. * gnu/packages/icu4c.scm (icu4c/fixed): Likewise. * gnu/packages/image.scm (libpng-apng): Likewise. * gnu/packages/make-bootstrap.scm (%guile-static): Likewise. * gnu/packages/pcre.scm (pcre/fixed): Likewise. * gnu/packages/perl.scm (perl/fixed): Likewise. * gnu/packages/ruby.scm (ruby-2.3, ruby-2.2, ruby-2.1) (ruby-1.8): Likewise. * gnu/packages/tls.scm (gnutls-3.5.13, gnutls/guile-2.2): Likewise. * gnu/packages/xml.scm (expat-2.2.1): Likewise. --- gnu/packages/image.scm | 1 - 1 file changed, 1 deletion(-) (limited to 'gnu/packages/image.scm') diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 504df60fb5..8a03cbc3c7 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -94,7 +94,6 @@ library. It supports almost all PNG features and is extensible.") (define-public libpng-apng (package (inherit libpng) - (replacement #f) ;libpng's replacement doesn't apply here (name "libpng-apng") (version (package-version libpng)) (arguments -- cgit v1.2.3 From dab536fe1ae5a8775a2b50fa50556445b6ac7818 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Thu, 6 Jul 2017 23:55:01 -0400 Subject: gnu: libtiff: Fix CVE-2017-{9936,10688}. * gnu/packages/patches/libtiff-CVE-2017-9936.patch, gnu/packages/patches/libtiff-CVE-2017-10688.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/image.scm (libtiff-4.0.8)[source]: Use them. Signed-off-by: Leo Famulari --- gnu/local.mk | 2 + gnu/packages/image.scm | 4 +- gnu/packages/patches/libtiff-CVE-2016-10688.patch | 92 +++++++++++++++++++++++ gnu/packages/patches/libtiff-CVE-2017-9936.patch | 47 ++++++++++++ 4 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/libtiff-CVE-2016-10688.patch create mode 100644 gnu/packages/patches/libtiff-CVE-2017-9936.patch (limited to 'gnu/packages/image.scm') diff --git a/gnu/local.mk b/gnu/local.mk index bccdd166f8..6f6db6d0ad 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -765,7 +765,9 @@ dist_patch_DATA = \ %D%/packages/patches/libtiff-CVE-2016-10092.patch \ %D%/packages/patches/libtiff-CVE-2016-10093.patch \ %D%/packages/patches/libtiff-CVE-2016-10094.patch \ + %D%/packages/patches/libtiff-CVE-2016-10688.patch \ %D%/packages/patches/libtiff-CVE-2017-5225.patch \ + %D%/packages/patches/libtiff-CVE-2017-9936.patch \ %D%/packages/patches/libtiff-assertion-failure.patch \ %D%/packages/patches/libtiff-divide-by-zero-ojpeg.patch \ %D%/packages/patches/libtiff-divide-by-zero-tiffcp.patch \ diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 8a03cbc3c7..fe9d2d5b13 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -391,7 +391,9 @@ collection of tools for doing simple manipulations of TIFF images.") (method url-fetch) (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-" version ".tar.gz")) - (patches (search-patches "libtiff-tiffgetfield-bugs.patch")) + (patches (search-patches "libtiff-tiffgetfield-bugs.patch" + "libtiff-CVE-2016-10688.patch" + "libtiff-CVE-2017-9936.patch")) (sha256 (base32 "0419mh6kkhz5fkyl77gv0in8x4d2jpdpfs147y8mj86rrjlabmsr")))))) diff --git a/gnu/packages/patches/libtiff-CVE-2016-10688.patch b/gnu/packages/patches/libtiff-CVE-2016-10688.patch new file mode 100644 index 0000000000..1630274c61 --- /dev/null +++ b/gnu/packages/patches/libtiff-CVE-2016-10688.patch @@ -0,0 +1,92 @@ +Fix CVE-2017-10688: + +http://bugzilla.maptools.org/show_bug.cgi?id=2712 +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10688 +https://security-tracker.debian.org/tracker/CVE-2017-10688 + +Patch lifted from upstream source repository (the changes to 'ChangeLog' +don't apply to the libtiff 4.0.8 release tarball). + +3rd party Git reference: + +https://github.com/vadz/libtiff/commit/6173a57d39e04d68b139f8c1aa499a24dbe74ba1 + +2017-06-30 Even Rouault + + * libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedXXXX() + functions associated with LONG8/SLONG8 data type, replace assertion +that + the file is BigTIFF, by a non-fatal error. + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2712 + Reported by team OWL337 + + + +/cvs/maptools/cvsroot/libtiff/ChangeLog,v <-- ChangeLog +new revision: 1.1259; previous revision: 1.1258 +/cvs/maptools/cvsroot/libtiff/libtiff/tif_dirwrite.c,v <-- +libtiff/tif_dirwrite.c +new revision: 1.86; previous revision: 1.85 + +Index: libtiff/libtiff/tif_dirwrite.c +=================================================================== +RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dirwrite.c,v +retrieving revision 1.85 +retrieving revision 1.86 +diff -u -r1.85 -r1.86 +--- libtiff/libtiff/tif_dirwrite.c 11 Jan 2017 16:09:02 -0000 1.85 ++++ libtiff/libtiff/tif_dirwrite.c 30 Jun 2017 17:29:44 -0000 1.86 +@@ -1,4 +1,4 @@ +-/* $Id: tif_dirwrite.c,v 1.85 2017-01-11 16:09:02 erouault Exp $ */ ++/* $Id: tif_dirwrite.c,v 1.86 2017-06-30 17:29:44 erouault Exp $ */ + + /* + * Copyright (c) 1988-1997 Sam Leffler +@@ -2111,7 +2111,10 @@ + { + uint64 m; + assert(sizeof(uint64)==8); +- assert(tif->tif_flags&TIFF_BIGTIFF); ++ if( !(tif->tif_flags&TIFF_BIGTIFF) ) { ++ TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","LONG8 not allowed for ClassicTIFF"); ++ return(0); ++ } + m=value; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8(&m); +@@ -2124,7 +2127,10 @@ + { + assert(count<0x20000000); + assert(sizeof(uint64)==8); +- assert(tif->tif_flags&TIFF_BIGTIFF); ++ if( !(tif->tif_flags&TIFF_BIGTIFF) ) { ++ TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","LONG8 not allowed for ClassicTIFF"); ++ return(0); ++ } + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8(value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG8,count,count*8,value)); +@@ -2136,7 +2142,10 @@ + { + int64 m; + assert(sizeof(int64)==8); +- assert(tif->tif_flags&TIFF_BIGTIFF); ++ if( !(tif->tif_flags&TIFF_BIGTIFF) ) { ++ TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","SLONG8 not allowed for ClassicTIFF"); ++ return(0); ++ } + m=value; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)(&m)); +@@ -2149,7 +2158,10 @@ + { + assert(count<0x20000000); + assert(sizeof(int64)==8); +- assert(tif->tif_flags&TIFF_BIGTIFF); ++ if( !(tif->tif_flags&TIFF_BIGTIFF) ) { ++ TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","SLONG8 not allowed for ClassicTIFF"); ++ return(0); ++ } + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8((uint64*)value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG8,count,count*8,value)); diff --git a/gnu/packages/patches/libtiff-CVE-2017-9936.patch b/gnu/packages/patches/libtiff-CVE-2017-9936.patch new file mode 100644 index 0000000000..fbdbcd0f0b --- /dev/null +++ b/gnu/packages/patches/libtiff-CVE-2017-9936.patch @@ -0,0 +1,47 @@ +Fix CVE-2017-9936: + +http://bugzilla.maptools.org/show_bug.cgi?id=2706 +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9936 +https://security-tracker.debian.org/tracker/CVE-2017-9936 + +Patch lifted from upstream source repository (the changes to 'ChangeLog' +don't apply to the libtiff 4.0.8 release tarball). + +3rd party Git reference: + +https://github.com/vadz/libtiff/commit/fe8d7165956b88df4837034a9161dc5fd20cf67a + +2017-06-26 Even Rouault + + * libtiff/tif_jbig.c: fix memory leak in error code path of +JBIGDecode() + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2706 + Reported by team OWL337 + +/cvs/maptools/cvsroot/libtiff/ChangeLog,v <-- ChangeLog +new revision: 1.1254; previous revision: 1.1253 +/cvs/maptools/cvsroot/libtiff/libtiff/tif_jbig.c,v <-- libtiff/tif_jbig.c +new revision: 1.16; previous revision: 1.15 + +Index: libtiff/libtiff/tif_jbig.c +=================================================================== +RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/tif_jbig.c,v +retrieving revision 1.15 +retrieving revision 1.16 +diff -u -r1.15 -r1.16 +--- libtiff/libtiff/tif_jbig.c 10 Mar 2010 18:56:48 -0000 1.15 ++++ libtiff/libtiff/tif_jbig.c 26 Jun 2017 15:20:00 -0000 1.16 +@@ -1,4 +1,4 @@ +-/* $Id: tif_jbig.c,v 1.15 2010-03-10 18:56:48 bfriesen Exp $ */ ++/* $Id: tif_jbig.c,v 1.16 2017-06-26 15:20:00 erouault Exp $ */ + + /* + * Copyright (c) 1988-1997 Sam Leffler +@@ -94,6 +94,7 @@ + jbg_strerror(decodeStatus) + #endif + ); ++ jbg_dec_free(&decoder); + return 0; + } + -- cgit v1.2.3 From ed40e7c5eb81b553b02042eba73612195f23a0d8 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 8 Jul 2017 13:05:45 +0200 Subject: gnu: libjpeg-turbo: Update to 1.5.2. * gnu/packages/image.scm (libjpeg-turbo): Update to 1.5.2. [arguments]<#:phases>: Remove. --- gnu/packages/image.scm | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'gnu/packages/image.scm') diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index fe9d2d5b13..a9e005768f 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -1086,29 +1086,19 @@ PNG, and performs PNG integrity checks and corrections.") (define-public libjpeg-turbo (package (name "libjpeg-turbo") - (version "1.5.1") + (version "1.5.2") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/" name "/" version "/" name "-" version ".tar.gz")) (sha256 (base32 - "0v365hm6z6lddcqagjj15wflk66rqyw75m73cqzl65rh4lyrshj1")))) + "0a5m0psfp5952y5vrcs0nbdz1y9wqzg2ms0xwrx752034wxr964h")))) (build-system gnu-build-system) (native-inputs `(("nasm" ,nasm))) (arguments - '(#:test-target "test" - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-env-on-MIPS - ;; This is borrowed from Debian's patchset for libjpeg - ;; https://sources.debian.net/data/main/libj/libjpeg-turbo/1:1.5.1-2/debian/patches/0001-Declare-env-on-MIPS-on-first-use-Courtesy-of-Aurelie.patch - (lambda _ - (substitute* "simd/jsimd_mips.c" - (("env = getenv\\(\"JSIMD_FORCEDSPR2") - "char *env = getenv(\"JSIMD_FORCEDSPR2")) - #t))))) + '(#:test-target "test")) (home-page "http://www.libjpeg-turbo.org/") (synopsis "SIMD-accelerated JPEG image handling library") (description "libjpeg-turbo is a JPEG image codec that accelerates baseline -- cgit v1.2.3 From 61adfb00b11cc16a70e60f19fd8e0a838a3ef608 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Fri, 7 Jul 2017 00:31:08 -0400 Subject: gnu: libtiff: Fix two integer overflows. * gnu/packages/patches/libtiff-tiffycbcrtorgb-integer-overflow.patch, gnu/packages/patches/libtiff-tiffycbcrtorgbinit-integer-overflow.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/image.scm (libtiff-4.0.8)[source]: Use them. --- gnu/local.mk | 2 + gnu/packages/image.scm | 4 +- .../libtiff-tiffycbcrtorgb-integer-overflow.patch | 57 ++++++++++++++++++++++ ...btiff-tiffycbcrtorgbinit-integer-overflow.patch | 43 ++++++++++++++++ 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/libtiff-tiffycbcrtorgb-integer-overflow.patch create mode 100644 gnu/packages/patches/libtiff-tiffycbcrtorgbinit-integer-overflow.patch (limited to 'gnu/packages/image.scm') diff --git a/gnu/local.mk b/gnu/local.mk index e405372699..781c28accb 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -783,6 +783,8 @@ dist_patch_DATA = \ %D%/packages/patches/libtiff-null-dereference.patch \ %D%/packages/patches/libtiff-tiffcp-underflow.patch \ %D%/packages/patches/libtiff-tiffgetfield-bugs.patch \ + %D%/packages/patches/libtiff-tiffycbcrtorgb-integer-overflow.patch \ + %D%/packages/patches/libtiff-tiffycbcrtorgbinit-integer-overflow.patch \ %D%/packages/patches/libtirpc-CVE-2017-8779.patch \ %D%/packages/patches/libtorrent-rasterbar-boost-compat.patch \ %D%/packages/patches/libtool-skip-tests2.patch \ diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index a9e005768f..139be62819 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -393,7 +393,9 @@ collection of tools for doing simple manipulations of TIFF images.") version ".tar.gz")) (patches (search-patches "libtiff-tiffgetfield-bugs.patch" "libtiff-CVE-2016-10688.patch" - "libtiff-CVE-2017-9936.patch")) + "libtiff-CVE-2017-9936.patch" + "libtiff-tiffycbcrtorgb-integer-overflow.patch" + "libtiff-tiffycbcrtorgbinit-integer-overflow.patch")) (sha256 (base32 "0419mh6kkhz5fkyl77gv0in8x4d2jpdpfs147y8mj86rrjlabmsr")))))) diff --git a/gnu/packages/patches/libtiff-tiffycbcrtorgb-integer-overflow.patch b/gnu/packages/patches/libtiff-tiffycbcrtorgb-integer-overflow.patch new file mode 100644 index 0000000000..060740d953 --- /dev/null +++ b/gnu/packages/patches/libtiff-tiffycbcrtorgb-integer-overflow.patch @@ -0,0 +1,57 @@ +Fix an integer overflow TIFFYCbCrtoRGB(): + +https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1844 + +3rd party Git reference: + +https://github.com/vadz/libtiff/commit/02669064e927074819ce1ed39aba0fccaa167717 + +2017-05-29 Even Rouault + + * libtiff/tif_color.c: TIFFYCbCrToRGBInit(): stricter clamping to avoid + int32 overflow in TIFFYCbCrtoRGB(). + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1844 + Credit to OSS Fuzz + + +/cvs/maptools/cvsroot/libtiff/ChangeLog,v <-- ChangeLog +new revision: 1.1241; previous revision: 1.1240 +/cvs/maptools/cvsroot/libtiff/libtiff/tif_color.c,v <-- libtiff/tif_color.c +new revision: 1.24; previous revision: 1.23 + +Index: libtiff/libtiff/tif_color.c +=================================================================== +RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/tif_color.c,v +retrieving revision 1.23 +retrieving revision 1.24 +diff -u -r1.23 -r1.24 +--- libtiff/libtiff/tif_color.c 13 May 2017 18:17:34 -0000 1.23 ++++ libtiff/libtiff/tif_color.c 29 May 2017 10:12:54 -0000 1.24 +@@ -1,4 +1,4 @@ +-/* $Id: tif_color.c,v 1.23 2017-05-13 18:17:34 erouault Exp $ */ ++/* $Id: tif_color.c,v 1.24 2017-05-29 10:12:54 erouault Exp $ */ + + /* + * Copyright (c) 1988-1997 Sam Leffler +@@ -275,10 +275,10 @@ + for (i = 0, x = -128; i < 256; i++, x++) { + int32 Cr = (int32)CLAMPw(Code2V(x, refBlackWhite[4] - 128.0F, + refBlackWhite[5] - 128.0F, 127), +- -128.0F * 64, 128.0F * 64); ++ -128.0F * 32, 128.0F * 32); + int32 Cb = (int32)CLAMPw(Code2V(x, refBlackWhite[2] - 128.0F, + refBlackWhite[3] - 128.0F, 127), +- -128.0F * 64, 128.0F * 64); ++ -128.0F * 32, 128.0F * 32); + + ycbcr->Cr_r_tab[i] = (int32)((D1*Cr + ONE_HALF)>>SHIFT); + ycbcr->Cb_b_tab[i] = (int32)((D3*Cb + ONE_HALF)>>SHIFT); +@@ -286,7 +286,7 @@ + ycbcr->Cb_g_tab[i] = D4*Cb + ONE_HALF; + ycbcr->Y_tab[i] = + (int32)CLAMPw(Code2V(x + 128, refBlackWhite[0], refBlackWhite[1], 255), +- -128.0F * 64, 128.0F * 64); ++ -128.0F * 32, 128.0F * 32); + } + } + diff --git a/gnu/packages/patches/libtiff-tiffycbcrtorgbinit-integer-overflow.patch b/gnu/packages/patches/libtiff-tiffycbcrtorgbinit-integer-overflow.patch new file mode 100644 index 0000000000..a990641a49 --- /dev/null +++ b/gnu/packages/patches/libtiff-tiffycbcrtorgbinit-integer-overflow.patch @@ -0,0 +1,43 @@ +Fix an integer overflow in initYCbCrConversion(): + +https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1907 + +3rd party Git reference + +https://github.com/vadz/libtiff/commit/468988860e0dae62ebbf991627c74bcbb4bd256f + + * libtiff/tif_getimage.c: initYCbCrConversion(): stricter validation for + refBlackWhite coefficients values. To avoid invalid float->int32 conversion + (when refBlackWhite[0] == 2147483648.f) + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1907 + Credit to OSS Fuzz + + +/cvs/maptools/cvsroot/libtiff/ChangeLog,v <-- ChangeLog +new revision: 1.1243; previous revision: 1.1242 +/cvs/maptools/cvsroot/libtiff/libtiff/tif_getimage.c,v <-- libtiff/tif_getimage.c +new revision: 1.107; previous revision: 1.106 + +Index: libtiff/libtiff/tif_getimage.c +=================================================================== +RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/tif_getimage.c,v +retrieving revision 1.106 +retrieving revision 1.107 +diff -u -r1.106 -r1.107 +--- libtiff/libtiff/tif_getimage.c 20 May 2017 11:29:02 -0000 1.106 ++++ libtiff/libtiff/tif_getimage.c 29 May 2017 11:29:06 -0000 1.107 +@@ -1,4 +1,4 @@ +-/* $Id: tif_getimage.c,v 1.106 2017-05-20 11:29:02 erouault Exp $ */ ++/* $Id: tif_getimage.c,v 1.107 2017-05-29 11:29:06 erouault Exp $ */ + + /* + * Copyright (c) 1991-1997 Sam Leffler +@@ -2241,7 +2241,7 @@ + + static int isInRefBlackWhiteRange(float f) + { +- return f >= (float)(-0x7FFFFFFF + 128) && f <= (float)0x7FFFFFFF; ++ return f > (float)(-0x7FFFFFFF + 128) && f < (float)0x7FFFFFFF; + } + + static int -- cgit v1.2.3