From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdkNL-0000mv-P4 for guix-patches@gnu.org; Sun, 30 Dec 2018 18:20:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdkNH-0005Av-Gf for guix-patches@gnu.org; Sun, 30 Dec 2018 18:20:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:54156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gdkNH-00059e-7i for guix-patches@gnu.org; Sun, 30 Dec 2018 18:20:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gdkNG-0002op-V6 for guix-patches@gnu.org; Sun, 30 Dec 2018 18:20:03 -0500 Subject: [bug#33933] [PATCH 2/4] gnu: libextractor: Fix CVE-2018-{20430, 20431}. References: <87pntihaht.fsf@gmail.com> In-Reply-To: <87pntihaht.fsf@gmail.com> Resent-Message-ID: From: Alex Vong Date: Mon, 31 Dec 2018 07:18:52 +0800 Message-ID: <87h8euhacj.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33933@debbugs.gnu.org Cc: alexvong1995@gmail.com --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-gnu-libextractor-Fix-CVE-2018-20430-20431.patch Content-Transfer-Encoding: quoted-printable From=20a155ee678aefe73eb8e209e7a6d4ace8afabcf92 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Mon, 31 Dec 2018 06:50:48 +0800 Subject: [PATCH 2/4] gnu: libextractor: Fix CVE-2018-{20430,20431}. * gnu/packages/patches/libextractor-CVE-2018-20430.patch, gnu/packages/patches/libextractor-CVE-2018-20431.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/gnunet.scm (libextractor)[source]: Use them. =2D-- gnu/local.mk | 2 + gnu/packages/gnunet.scm | 2 + .../patches/libextractor-CVE-2018-20430.patch | 60 +++++++++++++++++++ .../patches/libextractor-CVE-2018-20431.patch | 53 ++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 gnu/packages/patches/libextractor-CVE-2018-20430.patch create mode 100644 gnu/packages/patches/libextractor-CVE-2018-20431.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0bb020335..75634b741 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -888,6 +888,8 @@ dist_patch_DATA =3D \ %D%/packages/patches/libevent-2.1-skip-failing-test.patch \ %D%/packages/patches/libexif-CVE-2016-6328.patch \ %D%/packages/patches/libexif-CVE-2017-7544.patch \ + %D%/packages/patches/libextractor-CVE-2018-20430.patch \ + %D%/packages/patches/libextractor-CVE-2018-20431.patch \ %D%/packages/patches/libgcrypt-make-yat2m-reproducible.patch \ %D%/packages/patches/libgit2-mtime-0.patch \ %D%/packages/patches/libgit2-oom-test.patch \ diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm index 4a6952076..d9e903734 100644 =2D-- a/gnu/packages/gnunet.scm +++ b/gnu/packages/gnunet.scm @@ -73,6 +73,8 @@ (method url-fetch) (uri (string-append "mirror://gnu/libextractor/libextractor-" version ".tar.gz")) + (patches (search-patches "libextractor-CVE-2018-20430.patch" + "libextractor-CVE-2018-20431.patch")) (sha256 (base32 "1z1cb35griqzvshqdv5ck98dy0sgpsswn7fgiy7lbzi34sma8dg2")))) diff --git a/gnu/packages/patches/libextractor-CVE-2018-20430.patch b/gnu/p= ackages/patches/libextractor-CVE-2018-20430.patch new file mode 100644 index 000000000..570cd7c00 =2D-- /dev/null +++ b/gnu/packages/patches/libextractor-CVE-2018-20430.patch @@ -0,0 +1,60 @@ +Fix CVE-2018-20430: + +https://gnunet.org/bugs/view.php?id=3D5493 +https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-20430 +https://security-tracker.debian.org/tracker/CVE-2018-20430 + +Patch copied from upstream source repository: + +https://gnunet.org/git/libextractor.git/commit/?id=3Db405d707b36e0654900cb= a78e89f49779efea110 + +From b405d707b36e0654900cba78e89f49779efea110 Mon Sep 17 00:00:00 2001 +From: Christian Grothoff +Date: Thu, 20 Dec 2018 22:47:53 +0100 +Subject: [PATCH] fix #5493 (out of bounds read) + +--- + src/common/convert.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/common/convert.c b/src/common/convert.c +index c0edf21..2be2108 100644 +--- a/src/common/convert.c ++++ b/src/common/convert.c +@@ -36,8 +36,8 @@ + * string is returned. + */ + char * +-EXTRACTOR_common_convert_to_utf8 (const char *input,=20 +- size_t len,=20 ++EXTRACTOR_common_convert_to_utf8 (const char *input, ++ size_t len, + const char *charset) + { + #if HAVE_ICONV +@@ -52,7 +52,7 @@ EXTRACTOR_common_convert_to_utf8 (const char *input, + i =3D input; + cd =3D iconv_open ("UTF-8", charset); + if (cd =3D=3D (iconv_t) - 1) +- return strdup (i); ++ return strndup (i, len); + if (len > 1024 * 1024) + { + iconv_close (cd); +@@ -67,11 +67,11 @@ EXTRACTOR_common_convert_to_utf8 (const char *input, + } + itmp =3D tmp; + finSize =3D tmpSize; +- if (iconv (cd, (char **) &input, &len, &itmp, &finSize) =3D=3D SIZE_MAX) ++ if (iconv (cd, (char **) &input, &len, &itmp, &finSize) =3D=3D ((size_t= ) -1)) + { + iconv_close (cd); + free (tmp); +- return strdup (i); ++ return strndup (i, len); + } + ret =3D malloc (tmpSize - finSize + 1); + if (ret =3D=3D NULL) +--=20 +2.20.1 + diff --git a/gnu/packages/patches/libextractor-CVE-2018-20431.patch b/gnu/p= ackages/patches/libextractor-CVE-2018-20431.patch new file mode 100644 index 000000000..855c5ba64 =2D-- /dev/null +++ b/gnu/packages/patches/libextractor-CVE-2018-20431.patch @@ -0,0 +1,53 @@ +Fix CVE-2018-20431: + +https://gnunet.org/bugs/view.php?id=3D5494 +https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-20431 +https://security-tracker.debian.org/tracker/CVE-2018-20431 + +Patch copied from upstream source repository: + +https://gnunet.org/git/libextractor.git/commit/?id=3D489c4a540bb2c47444714= 41425b8932b97a153e7 + +To apply the patch to libextractor 1.8 release tarball, +hunk #1 which patches ChangeLog is removed.=20 + +From 489c4a540bb2c4744471441425b8932b97a153e7 Mon Sep 17 00:00:00 2001 +From: Christian Grothoff +Date: Thu, 20 Dec 2018 23:02:28 +0100 +Subject: [PATCH] fix #5494 + +--- + ChangeLog | 3 ++- + src/plugins/ole2_extractor.c | 9 +++++++-- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/src/plugins/ole2_extractor.c b/src/plugins/ole2_extractor.c +index 53fa1b9..a48b726 100644 +--- a/src/plugins/ole2_extractor.c ++++ b/src/plugins/ole2_extractor.c +@@ -173,7 +173,7 @@ struct ProcContext + EXTRACTOR_MetaDataProcessor proc; +=20 + /** +- * Closure for 'proc'. ++ * Closure for @e proc. + */ + void *proc_cls; +=20 +@@ -213,7 +213,12 @@ process_metadata (gpointer key, +=20 + if (G_VALUE_TYPE(gval) =3D=3D G_TYPE_STRING) + { +- contents =3D strdup (g_value_get_string (gval)); ++ const char *gvals; ++ ++ gvals =3D g_value_get_string (gval); ++ if (NULL =3D=3D gvals) ++ return; ++ contents =3D strdup (gvals); + } + else + { +--=20 +2.20.1 + =2D-=20 2.20.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQQwb8uPLAHCXSnTBVZh71Au9gJS8gUCXClSXAAKCRBh71Au9gJS 8uuiAQCl+HSN/kASF3J35E9EiGsVh86H/w80FECOB2f9LdzU6QEAlKCfKbwCOq0K feekZz3UXa94En1zFKqFzuph9ysbcwU= =wS43 -----END PGP SIGNATURE----- --==-=-=--