From e91e28d60c66362b7114d7a3ed7809609f2c1b4b Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 8 Oct 2015 08:42:13 -0400 Subject: gnu: wpa-supplicant: Update to 2.5. * gnu/packages/patches/wpa-supplicant-2015-2-fix.patch, gnu/packages/patches/wpa-supplicant-2015-3-fix.patch, gnu/packages/patches/wpa-supplicant-2015-4-fix-pt1.patch, gnu/packages/patches/wpa-supplicant-2015-4-fix-pt2.patch, gnu/packages/patches/wpa-supplicant-2015-4-fix-pt3.patch, gnu/packages/patches/wpa-supplicant-2015-4-fix-pt4.patch, gnu/packages/patches/wpa-supplicant-2015-4-fix-pt5.patch, gnu/packages/patches/wpa-supplicant-2015-5-fix.patch, gnu/packages/patches/wpa-supplicant-CVE-2015-1863.patch: Delete files. * gnu-system.am (dist_patch_DATA): Remove them. * gnu/packages/admin.scm (wpa-supplicant-minimal): Update to 2.5. Remove patches. --- gnu-system.am | 9 --------- 1 file changed, 9 deletions(-) (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 67879e9872..e1ae042b9d 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -657,15 +657,6 @@ dist_patch_DATA = \ gnu/packages/patches/wicd-template-instantiation.patch \ gnu/packages/patches/wicd-urwid-1.3.patch \ gnu/packages/patches/wmctrl-64-fix.patch \ - gnu/packages/patches/wpa-supplicant-CVE-2015-1863.patch \ - gnu/packages/patches/wpa-supplicant-2015-2-fix.patch \ - gnu/packages/patches/wpa-supplicant-2015-3-fix.patch \ - gnu/packages/patches/wpa-supplicant-2015-4-fix-pt1.patch \ - gnu/packages/patches/wpa-supplicant-2015-4-fix-pt2.patch \ - gnu/packages/patches/wpa-supplicant-2015-4-fix-pt3.patch \ - gnu/packages/patches/wpa-supplicant-2015-4-fix-pt4.patch \ - gnu/packages/patches/wpa-supplicant-2015-4-fix-pt5.patch \ - gnu/packages/patches/wpa-supplicant-2015-5-fix.patch \ gnu/packages/patches/xf86-video-ark-remove-mibstore.patch \ gnu/packages/patches/xf86-video-ast-remove-mibstore.patch \ gnu/packages/patches/xf86-video-geode-glibc-2.20.patch \ -- cgit 1.4.1 From 48e4a9f32f93c404b6fb4472164d8e00d12b2937 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 8 Oct 2015 10:01:02 -0400 Subject: gnu: unzip: Add various fixes. * gnu/packages/patches/unzip-increase-size-of-cfactorstr.patch: Delete file. Replace with ... * gnu/packages/patches/unzip-overflow-long-fsize.patch: ... this new file. * gnu/packages/patches/unzip-attribs-overflow.patch, gnu/packages/patches/unzip-fix-overflows-and-infloop.patch, gnu/packages/patches/unzip-format-secure.patch: New files. * gnu/packages/patches/unzip-CVE-2014-9636.patch: Replace contents with fixed patch from Fedora. * gnu-system.am (dist_patch_DATA): Adjust accordingly. * gnu/packages/zip.scm (unzip)[source]: Adjust list of patches. --- gnu-system.am | 5 +- gnu/packages/patches/unzip-CVE-2014-9636.patch | 40 +++----- gnu/packages/patches/unzip-attribs-overflow.patch | 16 +++ .../patches/unzip-fix-overflows-and-infloop.patch | 108 +++++++++++++++++++++ gnu/packages/patches/unzip-format-secure.patch | 94 ++++++++++++++++++ .../unzip-increase-size-of-cfactorstr.patch | 18 ---- .../patches/unzip-overflow-long-fsize.patch | 38 ++++++++ gnu/packages/zip.scm | 7 +- 8 files changed, 279 insertions(+), 47 deletions(-) create mode 100644 gnu/packages/patches/unzip-attribs-overflow.patch create mode 100644 gnu/packages/patches/unzip-fix-overflows-and-infloop.patch create mode 100644 gnu/packages/patches/unzip-format-secure.patch delete mode 100644 gnu/packages/patches/unzip-increase-size-of-cfactorstr.patch create mode 100644 gnu/packages/patches/unzip-overflow-long-fsize.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index e1ae042b9d..9c591327a1 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -641,8 +641,11 @@ dist_patch_DATA = \ gnu/packages/patches/unzip-CVE-2014-8141.patch \ gnu/packages/patches/unzip-CVE-2014-9636.patch \ gnu/packages/patches/unzip-allow-greater-hostver-values.patch \ - gnu/packages/patches/unzip-increase-size-of-cfactorstr.patch \ + gnu/packages/patches/unzip-attribs-overflow.patch \ + gnu/packages/patches/unzip-fix-overflows-and-infloop.patch \ + gnu/packages/patches/unzip-format-secure.patch \ gnu/packages/patches/unzip-initialize-symlink-flag.patch \ + gnu/packages/patches/unzip-overflow-long-fsize.patch \ gnu/packages/patches/unzip-remove-build-date.patch \ gnu/packages/patches/util-linux-tests.patch \ gnu/packages/patches/upower-builddir.patch \ diff --git a/gnu/packages/patches/unzip-CVE-2014-9636.patch b/gnu/packages/patches/unzip-CVE-2014-9636.patch index a38c3da51c..03c1e3c068 100644 --- a/gnu/packages/patches/unzip-CVE-2014-9636.patch +++ b/gnu/packages/patches/unzip-CVE-2014-9636.patch @@ -1,40 +1,28 @@ -Copied from Debian. +Copied from Fedora. -From: mancha -Date: Mon, 3 Nov 2014 -Subject: Info-ZIP UnZip buffer overflow -Bug-Debian: http://bugs.debian.org/776589 - -By carefully crafting a corrupt ZIP archive with "extra fields" that -purport to have compressed blocks larger than the corresponding -uncompressed blocks in STORED no-compression mode, an attacker can -trigger a heap overflow that can result in application crash or -possibly have other unspecified impact. - -This patch ensures that when extra fields use STORED mode, the -"compressed" and uncompressed block sizes match. +http://pkgs.fedoraproject.org/cgit/unzip.git/plain/unzip-6.0-overflow.patch?id=d18f821e +diff --git a/extract.c b/extract.c +index a0a4929..9ef80b3 100644 --- a/extract.c +++ b/extract.c -@@ -2228,6 +2228,7 @@ +@@ -2214,6 +2214,7 @@ static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata) ulg eb_ucsize; uch *eb_ucptr; int r; -+ ush eb_compr_method; ++ ush method; if (compr_offset < 4) /* field is not compressed: */ return PK_OK; /* do nothing and signal OK */ -@@ -2244,6 +2245,14 @@ - ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN)))) - return IZ_EF_TRUNC; /* no/bad compressed data! */ +@@ -2223,6 +2224,12 @@ static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata) + eb_size <= (compr_offset + EB_CMPRHEADLEN))) + return IZ_EF_TRUNC; /* no compressed data! */ -+ /* 2014-11-03 Michal Zalewski, SMS. -+ * For STORE method, compressed and uncompressed sizes must agree. -+ * http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=450 -+ */ -+ eb_compr_method = makeword( eb + (EB_HEADSIZE + compr_offset)); -+ if ((eb_compr_method == STORED) && (eb_size - compr_offset != eb_ucsize)) -+ return PK_ERR; ++ method = makeword(eb + (EB_HEADSIZE + compr_offset)); ++ if ((method == STORED) && (eb_size != compr_offset + EB_CMPRHEADLEN + eb_ucsize)) ++ return PK_ERR; /* compressed & uncompressed ++ * should match in STORED ++ * method */ + if ( #ifdef INT_16BIT diff --git a/gnu/packages/patches/unzip-attribs-overflow.patch b/gnu/packages/patches/unzip-attribs-overflow.patch new file mode 100644 index 0000000000..a24c31bb10 --- /dev/null +++ b/gnu/packages/patches/unzip-attribs-overflow.patch @@ -0,0 +1,16 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/unzip.git/plain/unzip-6.0-attribs-overflow.patch?id=d18f821e + +diff -up unzip60/zipinfo.c.attribs-overflow unzip60/zipinfo.c +--- unzip60/zipinfo.c.attribs-overflow 2009-11-30 09:55:39.000000000 +0100 ++++ unzip60/zipinfo.c 2009-11-30 09:56:42.844263244 +0100 +@@ -1881,7 +1881,7 @@ static int zi_short(__G) /* return PK- + #endif + int k, error, error_in_archive=PK_COOL; + unsigned hostnum, hostver, methid, methnum, xattr; +- char *p, workspace[12], attribs[16]; ++ char *p, workspace[12], attribs[17]; + char methbuf[5]; + static ZCONST char dtype[5]="NXFS"; /* normal, maximum, fast, superfast */ + static ZCONST char Far os[NUM_HOSTS+1][4] = { diff --git a/gnu/packages/patches/unzip-fix-overflows-and-infloop.patch b/gnu/packages/patches/unzip-fix-overflows-and-infloop.patch new file mode 100644 index 0000000000..33498db95e --- /dev/null +++ b/gnu/packages/patches/unzip-fix-overflows-and-infloop.patch @@ -0,0 +1,108 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/unzip.git/tree/unzip-6.0-heap-overflow-infloop.patch?id=d18f821e + +From bdd4a0cecd745cb4825e4508b5bdf2579731086a Mon Sep 17 00:00:00 2001 +From: Petr Stodulka +Date: Mon, 14 Sep 2015 18:23:17 +0200 +Subject: [PATCH 1/3] upstream fix for heap overflow + +https://bugzilla.redhat.com/attachment.cgi?id=1073002 +--- + crypt.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/crypt.c b/crypt.c +index 784e411..a8975f2 100644 +--- a/crypt.c ++++ b/crypt.c +@@ -465,7 +465,17 @@ int decrypt(__G__ passwrd) + GLOBAL(pInfo->encrypted) = FALSE; + defer_leftover_input(__G); + for (n = 0; n < RAND_HEAD_LEN; n++) { +- b = NEXTBYTE; ++ /* 2012-11-23 SMS. (OUSPG report.) ++ * Quit early if compressed size < HEAD_LEN. The resulting ++ * error message ("unable to get password") could be improved, ++ * but it's better than trying to read nonexistent data, and ++ * then continuing with a negative G.csize. (See ++ * fileio.c:readbyte()). ++ */ ++ if ((b = NEXTBYTE) == (ush)EOF) ++ { ++ return PK_ERR; ++ } + h[n] = (uch)b; + Trace((stdout, " (%02x)", h[n])); + } +-- +2.4.6 + + +From 4b48844661ff9569f2ecf582a387d46a5775b5d8 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Mon, 14 Sep 2015 18:24:56 +0200 +Subject: [PATCH 2/3] fix infinite loop when extracting empty bzip2 data + +Bug: https://sourceforge.net/p/infozip/patches/23/ +--- + extract.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/extract.c b/extract.c +index 7134bfe..29db027 100644 +--- a/extract.c ++++ b/extract.c +@@ -2733,6 +2733,12 @@ __GDEF + int repeated_buf_err; + bz_stream bstrm; + ++ if (G.incnt <= 0 && G.csize <= 0L) { ++ /* avoid an infinite loop */ ++ Trace((stderr, "UZbunzip2() got empty input\n")); ++ return 2; ++ } ++ + #if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) + wsize = G.redirect_size, redirSlide = G.redirect_buffer; +-- +2.4.6 + + +From bd150334fb4084f5555a6be26b015a0671cb5b74 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Tue, 22 Sep 2015 18:52:23 +0200 +Subject: [PATCH 3/3] extract: prevent unsigned overflow on invalid input + +Suggested-by: Stefan Cornelius +--- + extract.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/extract.c b/extract.c +index 29db027..b9ae667 100644 +--- a/extract.c ++++ b/extract.c +@@ -1257,8 +1257,17 @@ static int extract_or_test_entrylist(__G__ numchunk, + if (G.lrec.compression_method == STORED) { + zusz_t csiz_decrypted = G.lrec.csize; + +- if (G.pInfo->encrypted) ++ if (G.pInfo->encrypted) { ++ if (csiz_decrypted <= 12) { ++ /* handle the error now to prevent unsigned overflow */ ++ Info(slide, 0x401, ((char *)slide, ++ LoadFarStringSmall(ErrUnzipNoFile), ++ LoadFarString(InvalidComprData), ++ LoadFarStringSmall2(Inflate))); ++ return PK_ERR; ++ } + csiz_decrypted -= 12; ++ } + if (G.lrec.ucsize != csiz_decrypted) { + Info(slide, 0x401, ((char *)slide, + LoadFarStringSmall2(WrnStorUCSizCSizDiff), +-- +2.5.2 + diff --git a/gnu/packages/patches/unzip-format-secure.patch b/gnu/packages/patches/unzip-format-secure.patch new file mode 100644 index 0000000000..2a5f274b86 --- /dev/null +++ b/gnu/packages/patches/unzip-format-secure.patch @@ -0,0 +1,94 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/unzip.git/plain/unzip-6.0-format-secure.patch?id=d18f821e + +diff --git a/extract.c b/extract.c +index eeb2f57..a0a4929 100644 +--- a/extract.c ++++ b/extract.c +@@ -472,8 +472,8 @@ int extract_or_test_files(__G) /* return PK-type error code */ + */ + Info(slide, 0x401, ((char *)slide, + LoadFarString(CentSigMsg), j + blknum*DIR_BLKSIZ + 1)); +- Info(slide, 0x401, ((char *)slide, +- LoadFarString(ReportMsg))); ++ Info(slide, 0x401, ++ ((char *)slide,"%s", LoadFarString(ReportMsg))); + error_in_archive = PK_BADERR; + } + reached_end = TRUE; /* ...so no more left to do */ +@@ -752,8 +752,8 @@ int extract_or_test_files(__G) /* return PK-type error code */ + + #ifndef SFX + if (no_endsig_found) { /* just to make sure */ +- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); +- Info(slide, 0x401, ((char *)slide, LoadFarString(ReportMsg))); ++ Info(slide, 0x401, ((char *)slide,"%s", LoadFarString(EndSigMsg))); ++ Info(slide, 0x401, ((char *)slide,"%s", LoadFarString(ReportMsg))); + if (!error_in_archive) /* don't overwrite stronger error */ + error_in_archive = PK_WARN; + } +diff --git a/list.c b/list.c +index 15e0011..f7359c3 100644 +--- a/list.c ++++ b/list.c +@@ -181,7 +181,7 @@ int list_files(__G) /* return PK-type error code */ + Info(slide, 0x401, + ((char *)slide, LoadFarString(CentSigMsg), j)); + Info(slide, 0x401, +- ((char *)slide, LoadFarString(ReportMsg))); ++ ((char *)slide,"%s", LoadFarString(ReportMsg))); + return PK_BADERR; /* sig not found */ + } + } +@@ -507,7 +507,8 @@ int list_files(__G) /* return PK-type error code */ + && (!G.ecrec.is_zip64_archive) + && (memcmp(G.sig, end_central_sig, 4) != 0) + ) { /* just to make sure again */ +- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); ++ Info(slide, 0x401, ++ ((char *)slide,"%s", LoadFarString(EndSigMsg))); + error_in_archive = PK_WARN; /* didn't find sig */ + } + +@@ -591,7 +592,7 @@ int get_time_stamp(__G__ last_modtime, nmember) /* return PK-type error code */ + Info(slide, 0x401, + ((char *)slide, LoadFarString(CentSigMsg), j)); + Info(slide, 0x401, +- ((char *)slide, LoadFarString(ReportMsg))); ++ ((char *)slide,"%s", LoadFarString(ReportMsg))); + return PK_BADERR; /* sig not found */ + } + } +@@ -674,7 +675,7 @@ int get_time_stamp(__G__ last_modtime, nmember) /* return PK-type error code */ + ---------------------------------------------------------------------------*/ + + if (memcmp(G.sig, end_central_sig, 4)) { /* just to make sure again */ +- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); ++ Info(slide, 0x401, ((char *)slide,"%s", LoadFarString(EndSigMsg))); + error_in_archive = PK_WARN; + } + if (*nmember == 0L && error_in_archive <= PK_WARN) +diff --git a/zipinfo.c b/zipinfo.c +index 6e22cc8..ac5c61b 100644 +--- a/zipinfo.c ++++ b/zipinfo.c +@@ -771,7 +771,7 @@ int zipinfo(__G) /* return PK-type error code */ + Info(slide, 0x401, + ((char *)slide, LoadFarString(CentSigMsg), j)); + Info(slide, 0x401, +- ((char *)slide, LoadFarString(ReportMsg))); ++ ((char *)slide,"%s", LoadFarString(ReportMsg))); + error_in_archive = PK_BADERR; /* sig not found */ + break; + } +@@ -960,7 +960,8 @@ int zipinfo(__G) /* return PK-type error code */ + && (!G.ecrec.is_zip64_archive) + && (memcmp(G.sig, end_central_sig, 4) != 0) + ) { /* just to make sure again */ +- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); ++ Info(slide, 0x401, ++ ((char *)slide,"%s", LoadFarString(EndSigMsg))); + error_in_archive = PK_WARN; /* didn't find sig */ + } + diff --git a/gnu/packages/patches/unzip-increase-size-of-cfactorstr.patch b/gnu/packages/patches/unzip-increase-size-of-cfactorstr.patch deleted file mode 100644 index 3417ad873d..0000000000 --- a/gnu/packages/patches/unzip-increase-size-of-cfactorstr.patch +++ /dev/null @@ -1,18 +0,0 @@ -Copied from Debian. - -From: sms -Subject: Increase size of cfactorstr array to avoid buffer overflow -Bug-Debian: http://bugs.debian.org/741384 -X-Debian-version: 6.0-11 - ---- a/list.c -+++ b/list.c -@@ -97,7 +97,7 @@ - { - int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL; - #ifndef WINDLL -- char sgn, cfactorstr[10]; -+ char sgn, cfactorstr[12]; - int longhdr=(uO.vflag>1); - #endif - int date_format; diff --git a/gnu/packages/patches/unzip-overflow-long-fsize.patch b/gnu/packages/patches/unzip-overflow-long-fsize.patch new file mode 100644 index 0000000000..76963480d5 --- /dev/null +++ b/gnu/packages/patches/unzip-overflow-long-fsize.patch @@ -0,0 +1,38 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/unzip.git/plain/unzip-6.0-overflow-long-fsize.patch?id=d18f821e + +diff --git a/list.c b/list.c +index f7359c3..4c3d703 100644 +--- a/list.c ++++ b/list.c +@@ -97,7 +97,7 @@ int list_files(__G) /* return PK-type error code */ + { + int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL; + #ifndef WINDLL +- char sgn, cfactorstr[10]; ++ char sgn, cfactorstr[13]; + int longhdr=(uO.vflag>1); + #endif + int date_format; +@@ -339,7 +339,19 @@ int list_files(__G) /* return PK-type error code */ + G.crec.compression_method == ENHDEFLATED) { + methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3]; + } else if (methnum >= NUM_METHODS) { +- sprintf(&methbuf[4], "%03u", G.crec.compression_method); ++ /* 2013-02-26 SMS. ++ * http://sourceforge.net/tracker/?func=detail ++ * &aid=2861648&group_id=118012&atid=679786 ++ * Unexpectedly large compression methods overflow ++ * &methbuf[]. Use the old, three-digit decimal format ++ * for values which fit. Otherwise, sacrifice the ++ * colon, and use four-digit hexadecimal. ++ */ ++ if (G.crec.compression_method <= 999) { ++ sprintf( &methbuf[ 4], "%03u", G.crec.compression_method); ++ } else { ++ sprintf( &methbuf[ 3], "%04X", G.crec.compression_method); ++ } + } + + #if 0 /* GRR/Euro: add this? */ diff --git a/gnu/packages/zip.scm b/gnu/packages/zip.scm index f0f27ddfe2..83c452778c 100644 --- a/gnu/packages/zip.scm +++ b/gnu/packages/zip.scm @@ -86,9 +86,12 @@ Compression ratios of 2:1 to 3:1 are common for text files.") "unzip-CVE-2014-8141.patch" "unzip-CVE-2014-9636.patch" "unzip-allow-greater-hostver-values.patch" - "unzip-increase-size-of-cfactorstr.patch" "unzip-initialize-symlink-flag.patch" - "unzip-remove-build-date.patch"))))) + "unzip-remove-build-date.patch" + "unzip-attribs-overflow.patch" + "unzip-fix-overflows-and-infloop.patch" + "unzip-format-secure.patch" + "unzip-overflow-long-fsize.patch"))))) (build-system gnu-build-system) ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO (arguments -- cgit 1.4.1 From f956d661add890acb41592482a8a0c3fd90afd76 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 8 Oct 2015 10:43:40 -0400 Subject: gnu: libwmf: Add fixes for several security flaws. * gnu/packages/patches/libwmf-CAN-2004-0941.patch, gnu/packages/patches/libwmf-CVE-2007-0455.patch, gnu/packages/patches/libwmf-CVE-2007-2756.patch, gnu/packages/patches/libwmf-CVE-2007-3472.patch, gnu/packages/patches/libwmf-CVE-2007-3473.patch, gnu/packages/patches/libwmf-CVE-2007-3477.patch, gnu/packages/patches/libwmf-CVE-2009-3546.patch: New files. * gnu/packages/patches/libwmf-CVE-2015-0848+4588+4695+4696.patch: Delete file. Replace with ... * gnu/packages/patches/libwmf-CVE-2015-0848+CVE-2015-4588.patch, gnu/packages/patches/libwmf-CVE-2015-4695.patch, gnu/packages/patches/libwmf-CVE-2015-4696.patch: ... these new files. * gnu-system.am (dist_patch_DATA): Adjust accordingly. * gnu/packages/image.scm (libwmf)[source]: Adjust set of patches. --- gnu-system.am | 11 +- gnu/packages/image.scm | 13 +- gnu/packages/patches/libwmf-CAN-2004-0941.patch | 21 +++ gnu/packages/patches/libwmf-CVE-2007-0455.patch | 15 ++ gnu/packages/patches/libwmf-CVE-2007-2756.patch | 20 +++ gnu/packages/patches/libwmf-CVE-2007-3472.patch | 63 +++++++ gnu/packages/patches/libwmf-CVE-2007-3473.patch | 17 ++ gnu/packages/patches/libwmf-CVE-2007-3477.patch | 42 +++++ gnu/packages/patches/libwmf-CVE-2009-3546.patch | 17 ++ .../libwmf-CVE-2015-0848+4588+4695+4696.patch | 189 --------------------- .../libwmf-CVE-2015-0848+CVE-2015-4588.patch | 122 +++++++++++++ gnu/packages/patches/libwmf-CVE-2015-4695.patch | 60 +++++++ gnu/packages/patches/libwmf-CVE-2015-4696.patch | 27 +++ 13 files changed, 425 insertions(+), 192 deletions(-) create mode 100644 gnu/packages/patches/libwmf-CAN-2004-0941.patch create mode 100644 gnu/packages/patches/libwmf-CVE-2007-0455.patch create mode 100644 gnu/packages/patches/libwmf-CVE-2007-2756.patch create mode 100644 gnu/packages/patches/libwmf-CVE-2007-3472.patch create mode 100644 gnu/packages/patches/libwmf-CVE-2007-3473.patch create mode 100644 gnu/packages/patches/libwmf-CVE-2007-3477.patch create mode 100644 gnu/packages/patches/libwmf-CVE-2009-3546.patch delete mode 100644 gnu/packages/patches/libwmf-CVE-2015-0848+4588+4695+4696.patch create mode 100644 gnu/packages/patches/libwmf-CVE-2015-0848+CVE-2015-4588.patch create mode 100644 gnu/packages/patches/libwmf-CVE-2015-4695.patch create mode 100644 gnu/packages/patches/libwmf-CVE-2015-4696.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 9c591327a1..9ebaf527f2 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -536,9 +536,18 @@ dist_patch_DATA = \ gnu/packages/patches/libtheora-config-guess.patch \ gnu/packages/patches/libtool-skip-tests2.patch \ gnu/packages/patches/libssh-CVE-2014-0017.patch \ + gnu/packages/patches/libwmf-CAN-2004-0941.patch \ gnu/packages/patches/libwmf-CVE-2006-3376.patch \ + gnu/packages/patches/libwmf-CVE-2007-0455.patch \ + gnu/packages/patches/libwmf-CVE-2007-2756.patch \ + gnu/packages/patches/libwmf-CVE-2007-3472.patch \ + gnu/packages/patches/libwmf-CVE-2007-3473.patch \ + gnu/packages/patches/libwmf-CVE-2007-3477.patch \ gnu/packages/patches/libwmf-CVE-2009-1364.patch \ - gnu/packages/patches/libwmf-CVE-2015-0848+4588+4695+4696.patch \ + gnu/packages/patches/libwmf-CVE-2009-3546.patch \ + gnu/packages/patches/libwmf-CVE-2015-0848+CVE-2015-4588.patch \ + gnu/packages/patches/libwmf-CVE-2015-4695.patch \ + gnu/packages/patches/libwmf-CVE-2015-4696.patch \ gnu/packages/patches/lirc-localstatedir.patch \ gnu/packages/patches/libpthread-glibc-preparation.patch \ gnu/packages/patches/lm-sensors-hwmon-attrs.patch \ diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 23ad59ce9a..58338af5c6 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -148,9 +148,18 @@ collection of tools for doing simple manipulations of TIFF images.") (sha256 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v")) (patches - (map search-patch '("libwmf-CVE-2006-3376.patch" + (map search-patch '("libwmf-CAN-2004-0941.patch" + "libwmf-CVE-2006-3376.patch" + "libwmf-CVE-2007-0455.patch" + "libwmf-CVE-2007-2756.patch" + "libwmf-CVE-2007-3472.patch" + "libwmf-CVE-2007-3473.patch" + "libwmf-CVE-2007-3477.patch" "libwmf-CVE-2009-1364.patch" - "libwmf-CVE-2015-0848+4588+4695+4696.patch"))))) + "libwmf-CVE-2009-3546.patch" + "libwmf-CVE-2015-0848+CVE-2015-4588.patch" + "libwmf-CVE-2015-4695.patch" + "libwmf-CVE-2015-4696.patch"))))) (build-system gnu-build-system) (inputs diff --git a/gnu/packages/patches/libwmf-CAN-2004-0941.patch b/gnu/packages/patches/libwmf-CAN-2004-0941.patch new file mode 100644 index 0000000000..84dd9baee6 --- /dev/null +++ b/gnu/packages/patches/libwmf-CAN-2004-0941.patch @@ -0,0 +1,21 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CAN-2004-0941.patch + +--- libwmf-0.2.8.4/src/extra/gd/gd_png.c 2004-11-11 14:02:37.407589824 -0500 ++++ libwmf-0.2.8.4/src/extra/gd/gd_png.c 2004-11-11 14:04:29.672522960 -0500 +@@ -188,6 +188,14 @@ + + png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + &interlace_type, NULL, NULL); ++ if (overflow2(sizeof (int), width)) ++ { ++ return NULL; ++ } ++ if (overflow2(sizeof (int) * width, height)) ++ { ++ return NULL; ++ } + if ((color_type == PNG_COLOR_TYPE_RGB) || + (color_type == PNG_COLOR_TYPE_RGB_ALPHA)) + { diff --git a/gnu/packages/patches/libwmf-CVE-2007-0455.patch b/gnu/packages/patches/libwmf-CVE-2007-0455.patch new file mode 100644 index 0000000000..ceefc75bf2 --- /dev/null +++ b/gnu/packages/patches/libwmf-CVE-2007-0455.patch @@ -0,0 +1,15 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CVE-2007-0455.patch + +--- libwmf-0.2.8.4/src/extra/gd/gdft.c 2010-12-06 11:18:26.000000000 +0000 ++++ libwmf-0.2.8.4/src/extra/gd/gdft.c 2010-12-06 11:21:09.000000000 +0000 +@@ -811,7 +811,7 @@ + { + ch = c & 0xFF; /* don't extend sign */ + } +- next++; ++ if (*next) next++; + } + else + { diff --git a/gnu/packages/patches/libwmf-CVE-2007-2756.patch b/gnu/packages/patches/libwmf-CVE-2007-2756.patch new file mode 100644 index 0000000000..feafac535a --- /dev/null +++ b/gnu/packages/patches/libwmf-CVE-2007-2756.patch @@ -0,0 +1,20 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CVE-2007-2756.patch + +--- libwmf-0.2.8.4/src/extra/gd/gd_png.c 1 Apr 2007 20:41:01 -0000 1.21.2.1 ++++ libwmf-0.2.8.4/src/extra/gd/gd_png.c 16 May 2007 19:06:11 -0000 +@@ -78,8 +78,11 @@ + gdPngReadData (png_structp png_ptr, + png_bytep data, png_size_t length) + { +- gdGetBuf (data, length, (gdIOCtx *) +- png_get_io_ptr (png_ptr)); ++ int check; ++ check = gdGetBuf (data, length, (gdIOCtx *) png_get_io_ptr (png_ptr)); ++ if (check != length) { ++ png_error(png_ptr, "Read Error: truncated data"); ++ } + } + + static void diff --git a/gnu/packages/patches/libwmf-CVE-2007-3472.patch b/gnu/packages/patches/libwmf-CVE-2007-3472.patch new file mode 100644 index 0000000000..180bdb5fc2 --- /dev/null +++ b/gnu/packages/patches/libwmf-CVE-2007-3472.patch @@ -0,0 +1,63 @@ +Based on a patch from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CVE-2007-3472.patch + +--- libwmf-0.2.8.4/src/extra/gd/gd.c ++++ libwmf-0.2.8.4/src/extra/gd/gd.c +@@ -106,6 +106,18 @@ + gdImagePtr im; + unsigned long cpa_size; + ++ if (overflow2(sx, sy)) { ++ return NULL; ++ } ++ ++ if (overflow2(sizeof (int *), sy)) { ++ return NULL; ++ } ++ ++ if (overflow2(sizeof(int), sx)) { ++ return NULL; ++ } ++ + im = (gdImage *) gdMalloc (sizeof (gdImage)); + if (im == 0) return 0; + memset (im, 0, sizeof (gdImage)); +--- libwmf-0.2.8.4/src/extra/gd/gdhelpers.c 2010-12-06 11:47:31.000000000 +0000 ++++ libwmf-0.2.8.4/src/extra/gd/gdhelpers.c 2010-12-06 11:48:04.000000000 +0000 +@@ -2,6 +2,7 @@ + #include "gdhelpers.h" + #include + #include ++#include + + /* TBB: gd_strtok_r is not portable; provide an implementation */ + +@@ -94,3 +95,18 @@ + { + free (ptr); + } ++ ++int overflow2(int a, int b) ++{ ++ if(a < 0 || b < 0) { ++ fprintf(stderr, "gd warning: one parameter to a memory allocation multiplication is negative, failing operation gracefully\n"); ++ return 1; ++ } ++ if(b == 0) ++ return 0; ++ if(a > INT_MAX / b) { ++ fprintf(stderr, "gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n"); ++ return 1; ++ } ++ return 0; ++} +--- libwmf-0.2.8.4/src/extra/gd/gdhelpers.h 2010-12-06 11:47:17.000000000 +0000 ++++ libwmf-0.2.8.4/src/extra/gd/gdhelpers.h 2010-12-06 11:48:36.000000000 +0000 +@@ -15,4 +15,6 @@ + void *gdMalloc(size_t size); + void *gdRealloc(void *ptr, size_t size); + ++int overflow2(int a, int b); ++ + #endif /* GDHELPERS_H */ diff --git a/gnu/packages/patches/libwmf-CVE-2007-3473.patch b/gnu/packages/patches/libwmf-CVE-2007-3473.patch new file mode 100644 index 0000000000..cb96c94a47 --- /dev/null +++ b/gnu/packages/patches/libwmf-CVE-2007-3473.patch @@ -0,0 +1,17 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CVE-2007-3473.patch + +--- libwmf-0.2.8.4/src/extra/gd/gd.c ++++ libwmf-0.2.8.4/src/extra/gd/gd.c +@@ -2483,6 +2483,10 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm (FILE * fd) + } + bytes = (w * h / 8) + 1; + im = gdImageCreate (w, h); ++ if (!im) { ++ return 0; ++ } ++ + gdImageColorAllocate (im, 255, 255, 255); + gdImageColorAllocate (im, 0, 0, 0); + x = 0; diff --git a/gnu/packages/patches/libwmf-CVE-2007-3477.patch b/gnu/packages/patches/libwmf-CVE-2007-3477.patch new file mode 100644 index 0000000000..e9f6f4278b --- /dev/null +++ b/gnu/packages/patches/libwmf-CVE-2007-3477.patch @@ -0,0 +1,42 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CVE-2007-3477.patch + +--- libwmf-0.2.8.4/src/extra/gd/gd.c ++++ libwmf-0.2.8.4/src/extra/gd/gd.c +@@ -1335,10 +1335,31 @@ + int w2, h2; + w2 = w / 2; + h2 = h / 2; +- while (e < s) +- { +- e += 360; +- } ++ ++ if ((s % 360) == (e % 360)) { ++ s = 0; e = 360; ++ } else { ++ if (s > 360) { ++ s = s % 360; ++ } ++ ++ if (e > 360) { ++ e = e % 360; ++ } ++ ++ while (s < 0) { ++ s += 360; ++ } ++ ++ while (e < s) { ++ e += 360; ++ } ++ ++ if (s == e) { ++ s = 0; e = 360; ++ } ++ } ++ + for (i = s; (i <= e); i++) + { + int x, y; diff --git a/gnu/packages/patches/libwmf-CVE-2009-3546.patch b/gnu/packages/patches/libwmf-CVE-2009-3546.patch new file mode 100644 index 0000000000..ef76fe0736 --- /dev/null +++ b/gnu/packages/patches/libwmf-CVE-2009-3546.patch @@ -0,0 +1,17 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CVE-2009-3546.patch + +--- libwmf-0.2.8.4/src/extra/gd/gd_gd.c 2010-12-06 14:56:06.000000000 +0000 ++++ libwmf-0.2.8.4/src/extra/gd/gd_gd.c 2010-12-06 14:57:04.000000000 +0000 +@@ -42,6 +42,10 @@ + { + goto fail1; + } ++ if (&im->colorsTotal > gdMaxColors) ++ { ++ goto fail1; ++ } + } + /* Int to accommodate truecolor single-color transparency */ + if (!gdGetInt (&im->transparent, in)) diff --git a/gnu/packages/patches/libwmf-CVE-2015-0848+4588+4695+4696.patch b/gnu/packages/patches/libwmf-CVE-2015-0848+4588+4695+4696.patch deleted file mode 100644 index 091fc8bb41..0000000000 --- a/gnu/packages/patches/libwmf-CVE-2015-0848+4588+4695+4696.patch +++ /dev/null @@ -1,189 +0,0 @@ -Fix CVE-2015-0848, CVE-2015-4588, CVE-2015-4695, and CVE-2015-4696. -Copied from Debian. - ---- libwmf-0.2.8.4.orig/src/player/meta.h -+++ libwmf-0.2.8.4/src/player/meta.h -@@ -1565,7 +1565,7 @@ static int meta_rgn_create (wmfAPI* API, - objects = P->objects; - - i = 0; -- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; -+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; - - if (i == NUM_OBJECTS (API)) - { WMF_ERROR (API,"Object out of range!"); -@@ -2142,7 +2142,7 @@ static int meta_dib_brush (wmfAPI* API,w - objects = P->objects; - - i = 0; -- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; -+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; - - if (i == NUM_OBJECTS (API)) - { WMF_ERROR (API,"Object out of range!"); -@@ -2593,9 +2593,10 @@ static int meta_dc_restore (wmfAPI* API, - polyrect.BR = 0; - - polyrect.count = 0; -+ -+ if (FR->region_clip) FR->region_clip (API,&polyrect); - } - -- if (FR->region_clip) FR->region_clip (API,&polyrect); - - return (changed); - } -@@ -3067,7 +3068,7 @@ static int meta_pen_create (wmfAPI* API, - objects = P->objects; - - i = 0; -- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; -+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; - - if (i == NUM_OBJECTS (API)) - { WMF_ERROR (API,"Object out of range!"); -@@ -3181,7 +3182,7 @@ static int meta_brush_create (wmfAPI* AP - objects = P->objects; - - i = 0; -- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; -+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; - - if (i == NUM_OBJECTS (API)) - { WMF_ERROR (API,"Object out of range!"); -@@ -3288,7 +3289,7 @@ static int meta_font_create (wmfAPI* API - objects = P->objects; - - i = 0; -- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; -+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; - - if (i == NUM_OBJECTS (API)) - { WMF_ERROR (API,"Object out of range!"); -@@ -3396,7 +3397,7 @@ static int meta_palette_create (wmfAPI* - objects = P->objects; - - i = 0; -- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; -+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; - - if (i == NUM_OBJECTS (API)) - { WMF_ERROR (API,"Object out of range!"); ---- libwmf-0.2.8.4.orig/src/ipa/ipa.h -+++ libwmf-0.2.8.4/src/ipa/ipa.h -@@ -48,7 +48,7 @@ static int ReadBlobByte (BMPS - static unsigned short ReadBlobLSBShort (BMPSource*); - static unsigned long ReadBlobLSBLong (BMPSource*); - static long TellBlob (BMPSource*); --static void DecodeImage (wmfAPI*,wmfBMP*,BMPSource*,unsigned int,unsigned char*); -+static int DecodeImage (wmfAPI*,wmfBMP*,BMPSource*,unsigned int,unsigned char*); - static void ReadBMPImage (wmfAPI*,wmfBMP*,BMPSource*); - static int ExtractColor (wmfAPI*,wmfBMP*,wmfRGB*,unsigned int,unsigned int); - static void SetColor (wmfAPI*,wmfBMP*,wmfRGB*,unsigned char,unsigned int,unsigned int); ---- libwmf-0.2.8.4.orig/src/ipa/ipa/bmp.h -+++ libwmf-0.2.8.4/src/ipa/ipa/bmp.h -@@ -859,7 +859,7 @@ static long TellBlob (BMPSource* src) - % - % - */ --static void DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int compression,unsigned char* pixels) -+static int DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int compression,unsigned char* pixels) - { int byte; - int count; - int i; -@@ -870,12 +870,14 @@ static void DecodeImage (wmfAPI* API,wmf - U32 u; - - unsigned char* q; -+ unsigned char* end; - - for (u = 0; u < ((U32) bmp->width * (U32) bmp->height); u++) pixels[u] = 0; - - byte = 0; - x = 0; - q = pixels; -+ end = pixels + bmp->width * bmp->height; - - for (y = 0; y < bmp->height; ) - { count = ReadBlobByte (src); -@@ -884,7 +886,10 @@ static void DecodeImage (wmfAPI* API,wmf - { /* Encoded mode. */ - byte = ReadBlobByte (src); - for (i = 0; i < count; i++) -- { if (compression == 1) -+ { -+ if (q == end) -+ return 0; -+ if (compression == 1) - { (*(q++)) = (unsigned char) byte; - } - else -@@ -896,13 +901,15 @@ static void DecodeImage (wmfAPI* API,wmf - else - { /* Escape mode. */ - count = ReadBlobByte (src); -- if (count == 0x01) return; -+ if (count == 0x01) return 1; - switch (count) - { - case 0x00: - { /* End of line. */ - x = 0; - y++; -+ if (y >= bmp->height) -+ return 0; - q = pixels + y * bmp->width; - break; - } -@@ -910,13 +917,20 @@ static void DecodeImage (wmfAPI* API,wmf - { /* Delta mode. */ - x += ReadBlobByte (src); - y += ReadBlobByte (src); -+ if (y >= bmp->height) -+ return 0; -+ if (x >= bmp->width) -+ return 0; - q = pixels + y * bmp->width + x; - break; - } - default: - { /* Absolute mode. */ - for (i = 0; i < count; i++) -- { if (compression == 1) -+ { -+ if (q == end) -+ return 0; -+ if (compression == 1) - { (*(q++)) = ReadBlobByte (src); - } - else -@@ -943,7 +957,7 @@ static void DecodeImage (wmfAPI* API,wmf - byte = ReadBlobByte (src); /* end of line */ - byte = ReadBlobByte (src); - -- return; -+ return 1; - } - - /* -@@ -1143,8 +1157,18 @@ static void ReadBMPImage (wmfAPI* API,wm - } - } - else -- { /* Convert run-length encoded raster pixels. */ -- DecodeImage (API,bmp,src,(unsigned int) bmp_info.compression,data->image); -+ { -+ if (bmp_info.bits_per_pixel == 8) /* Convert run-length encoded raster pixels. */ -+ { -+ if (!DecodeImage (API,bmp,src,(unsigned int) bmp_info.compression,data->image)) -+ { WMF_ERROR (API,"corrupt bmp"); -+ API->err = wmf_E_BadFormat; -+ } -+ } -+ else -+ { WMF_ERROR (API,"Unexpected pixel depth"); -+ API->err = wmf_E_BadFormat; -+ } - } - - if (ERR (API)) diff --git a/gnu/packages/patches/libwmf-CVE-2015-0848+CVE-2015-4588.patch b/gnu/packages/patches/libwmf-CVE-2015-0848+CVE-2015-4588.patch new file mode 100644 index 0000000000..871be1d267 --- /dev/null +++ b/gnu/packages/patches/libwmf-CVE-2015-0848+CVE-2015-4588.patch @@ -0,0 +1,122 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CVE-2015-0848+CVE-2015-4588.patch + +--- libwmf-0.2.8.4/src/ipa/ipa/bmp.h 2015-06-08 14:46:24.591876404 +0100 ++++ libwmf-0.2.8.4/src/ipa/ipa/bmp.h 2015-06-08 14:46:35.345993247 +0100 +@@ -859,7 +859,7 @@ + % + % + */ +-static void DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int compression,unsigned char* pixels) ++static int DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int compression,unsigned char* pixels) + { int byte; + int count; + int i; +@@ -870,12 +870,14 @@ + U32 u; + + unsigned char* q; ++ unsigned char* end; + + for (u = 0; u < ((U32) bmp->width * (U32) bmp->height); u++) pixels[u] = 0; + + byte = 0; + x = 0; + q = pixels; ++ end = pixels + bmp->width * bmp->height; + + for (y = 0; y < bmp->height; ) + { count = ReadBlobByte (src); +@@ -884,7 +886,10 @@ + { /* Encoded mode. */ + byte = ReadBlobByte (src); + for (i = 0; i < count; i++) +- { if (compression == 1) ++ { ++ if (q == end) ++ return 0; ++ if (compression == 1) + { (*(q++)) = (unsigned char) byte; + } + else +@@ -896,13 +901,15 @@ + else + { /* Escape mode. */ + count = ReadBlobByte (src); +- if (count == 0x01) return; ++ if (count == 0x01) return 1; + switch (count) + { + case 0x00: + { /* End of line. */ + x = 0; + y++; ++ if (y >= bmp->height) ++ return 0; + q = pixels + y * bmp->width; + break; + } +@@ -910,13 +917,20 @@ + { /* Delta mode. */ + x += ReadBlobByte (src); + y += ReadBlobByte (src); ++ if (y >= bmp->height) ++ return 0; ++ if (x >= bmp->width) ++ return 0; + q = pixels + y * bmp->width + x; + break; + } + default: + { /* Absolute mode. */ + for (i = 0; i < count; i++) +- { if (compression == 1) ++ { ++ if (q == end) ++ return 0; ++ if (compression == 1) + { (*(q++)) = ReadBlobByte (src); + } + else +@@ -943,7 +957,7 @@ + byte = ReadBlobByte (src); /* end of line */ + byte = ReadBlobByte (src); + +- return; ++ return 1; + } + + /* +@@ -1143,8 +1157,18 @@ + } + } + else +- { /* Convert run-length encoded raster pixels. */ +- DecodeImage (API,bmp,src,(unsigned int) bmp_info.compression,data->image); ++ { ++ if (bmp_info.bits_per_pixel == 8) /* Convert run-length encoded raster pixels. */ ++ { ++ if (!DecodeImage (API,bmp,src,(unsigned int) bmp_info.compression,data->image)) ++ { WMF_ERROR (API,"corrupt bmp"); ++ API->err = wmf_E_BadFormat; ++ } ++ } ++ else ++ { WMF_ERROR (API,"Unexpected pixel depth"); ++ API->err = wmf_E_BadFormat; ++ } + } + + if (ERR (API)) +--- libwmf-0.2.8.4/src/ipa/ipa.h 2015-06-08 14:46:24.590876393 +0100 ++++ libwmf-0.2.8.4/src/ipa/ipa.h 2015-06-08 14:46:35.345993247 +0100 +@@ -48,7 +48,7 @@ + static unsigned short ReadBlobLSBShort (BMPSource*); + static unsigned long ReadBlobLSBLong (BMPSource*); + static long TellBlob (BMPSource*); +-static void DecodeImage (wmfAPI*,wmfBMP*,BMPSource*,unsigned int,unsigned char*); ++static int DecodeImage (wmfAPI*,wmfBMP*,BMPSource*,unsigned int,unsigned char*); + static void ReadBMPImage (wmfAPI*,wmfBMP*,BMPSource*); + static int ExtractColor (wmfAPI*,wmfBMP*,wmfRGB*,unsigned int,unsigned int); + static void SetColor (wmfAPI*,wmfBMP*,wmfRGB*,unsigned char,unsigned int,unsigned int); diff --git a/gnu/packages/patches/libwmf-CVE-2015-4695.patch b/gnu/packages/patches/libwmf-CVE-2015-4695.patch new file mode 100644 index 0000000000..42c4d55f40 --- /dev/null +++ b/gnu/packages/patches/libwmf-CVE-2015-4695.patch @@ -0,0 +1,60 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CVE-2015-4695.patch + +--- libwmf-0.2.8.4/src/player/meta.h ++++ libwmf-0.2.8.4/src/player/meta.h +@@ -1565,7 +1565,7 @@ static int meta_rgn_create (wmfAPI* API, + objects = P->objects; + + i = 0; +- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; ++ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; + + if (i == NUM_OBJECTS (API)) + { WMF_ERROR (API,"Object out of range!"); +@@ -2142,7 +2142,7 @@ static int meta_dib_brush (wmfAPI* API,w + objects = P->objects; + + i = 0; +- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; ++ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; + + if (i == NUM_OBJECTS (API)) + { WMF_ERROR (API,"Object out of range!"); +@@ -3067,7 +3067,7 @@ static int meta_pen_create (wmfAPI* API, + objects = P->objects; + + i = 0; +- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; ++ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; + + if (i == NUM_OBJECTS (API)) + { WMF_ERROR (API,"Object out of range!"); +@@ -3181,7 +3181,7 @@ static int meta_brush_create (wmfAPI* AP + objects = P->objects; + + i = 0; +- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; ++ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; + + if (i == NUM_OBJECTS (API)) + { WMF_ERROR (API,"Object out of range!"); +@@ -3288,7 +3288,7 @@ static int meta_font_create (wmfAPI* API + objects = P->objects; + + i = 0; +- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; ++ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; + + if (i == NUM_OBJECTS (API)) + { WMF_ERROR (API,"Object out of range!"); +@@ -3396,7 +3396,7 @@ static int meta_palette_create (wmfAPI* + objects = P->objects; + + i = 0; +- while (objects[i].type && (i < NUM_OBJECTS (API))) i++; ++ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++; + + if (i == NUM_OBJECTS (API)) + { WMF_ERROR (API,"Object out of range!"); diff --git a/gnu/packages/patches/libwmf-CVE-2015-4696.patch b/gnu/packages/patches/libwmf-CVE-2015-4696.patch new file mode 100644 index 0000000000..3674458c98 --- /dev/null +++ b/gnu/packages/patches/libwmf-CVE-2015-4696.patch @@ -0,0 +1,27 @@ +Copied from Fedora. + +http://pkgs.fedoraproject.org/cgit/libwmf.git/tree/libwmf-0.2.8.4-CVE-2015-4696.patch + +--- libwmf-0.2.8.4/src/player/meta.h ++++ libwmf-0.2.8.4/src/player/meta.h +@@ -2585,6 +2585,8 @@ + polyrect.BR[i] = clip->rects[i].BR; + } + ++ if (FR->region_clip) FR->region_clip (API,&polyrect); ++ + wmf_free (API,polyrect.TL); + wmf_free (API,polyrect.BR); + } +@@ -2593,9 +2595,10 @@ + polyrect.BR = 0; + + polyrect.count = 0; ++ ++ if (FR->region_clip) FR->region_clip (API,&polyrect); + } + +- if (FR->region_clip) FR->region_clip (API,&polyrect); + + return (changed); + } -- cgit 1.4.1 From b5881775ac2db345bf5826d6351366346ff03275 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 8 Oct 2015 10:55:04 -0400 Subject: gnu: libunwind: Add fix for CVE-2015-3239. * gnu/packages/patches/libunwind-CVE-2015-3239.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/libunwind.scm (libunwind)[source]: Add patch. --- gnu-system.am | 1 + gnu/packages/libunwind.scm | 5 ++++- gnu/packages/patches/libunwind-CVE-2015-3239.patch | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/libunwind-CVE-2015-3239.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 9ebaf527f2..c2dc323a61 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -536,6 +536,7 @@ dist_patch_DATA = \ gnu/packages/patches/libtheora-config-guess.patch \ gnu/packages/patches/libtool-skip-tests2.patch \ gnu/packages/patches/libssh-CVE-2014-0017.patch \ + gnu/packages/patches/libunwind-CVE-2015-3239.patch \ gnu/packages/patches/libwmf-CAN-2004-0941.patch \ gnu/packages/patches/libwmf-CVE-2006-3376.patch \ gnu/packages/patches/libwmf-CVE-2007-0455.patch \ diff --git a/gnu/packages/libunwind.scm b/gnu/packages/libunwind.scm index 5e813e55c1..ab3496277a 100644 --- a/gnu/packages/libunwind.scm +++ b/gnu/packages/libunwind.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,6 +19,7 @@ (define-module (gnu packages libunwind) #:use-module (guix packages) + #:use-module (gnu packages) #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (guix licenses)) @@ -32,7 +34,8 @@ version ".tar.gz")) (sha256 (base32 - "16nhx2pahh9d62mvszc88q226q5lwjankij276fxwrm8wb50zzlx")))) + "16nhx2pahh9d62mvszc88q226q5lwjankij276fxwrm8wb50zzlx")) + (patches (list (search-patch "libunwind-CVE-2015-3239.patch"))))) (build-system gnu-build-system) (arguments ;; FIXME: As of glibc 2.17, we get 3 out of 34 test failures. diff --git a/gnu/packages/patches/libunwind-CVE-2015-3239.patch b/gnu/packages/patches/libunwind-CVE-2015-3239.patch new file mode 100644 index 0000000000..3f11ac7337 --- /dev/null +++ b/gnu/packages/patches/libunwind-CVE-2015-3239.patch @@ -0,0 +1,17 @@ +Copied from Fedora. + +https://bugzilla.redhat.com/show_bug.cgi?id=1232265 +http://pkgs.fedoraproject.org/cgit/libunwind.git/tree/libunwind-1.1-fix-CVE-2015-3239.patch + +diff -up libunwind-1.1/include/dwarf_i.h.CVE20153239 libunwind-1.1/include/dwarf_i.h +--- libunwind-1.1/include/dwarf_i.h.CVE20153239 2015-07-10 13:38:36.404996748 -0400 ++++ libunwind-1.1/include/dwarf_i.h 2015-07-10 13:39:25.050707613 -0400 +@@ -20,7 +20,7 @@ + extern const uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH]; + /* REG is evaluated multiple times; it better be side-effects free! */ + # define dwarf_to_unw_regnum(reg) \ +- (((reg) <= DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0) ++ (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0) + #endif + + #ifdef UNW_LOCAL_ONLY -- cgit 1.4.1