From: Leo Famulari <leo@famulari.name>
To: 29793@debbugs.gnu.org
Subject: [bug#29793] [PATCH] gnu: libarchive: Fix CVE-2017-14502.
Date: Wed, 20 Dec 2017 19:43:18 -0500 [thread overview]
Message-ID: <b2a07b42fc8d1ec284f33d3d5940117c2402d196.1513816998.git.leo@famulari.name> (raw)
* gnu/packages/patches/libarchive-CVE-2017-14502.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/backup.scm (libarchive-3.3.2)[source]: Use it.
---
gnu/local.mk | 1 +
gnu/packages/backup.scm | 3 +-
.../patches/libarchive-CVE-2017-14502.patch | 40 ++++++++++++++++++++++
3 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/libarchive-CVE-2017-14502.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index efb91fd82..d5cd0b339 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -791,6 +791,7 @@ dist_patch_DATA = \
%D%/packages/patches/liba52-set-soname.patch \
%D%/packages/patches/liba52-use-mtune-not-mcpu.patch \
%D%/packages/patches/libarchive-CVE-2017-14166.patch \
+ %D%/packages/patches/libarchive-CVE-2017-14502.patch \
%D%/packages/patches/libbase-fix-includes.patch \
%D%/packages/patches/libbase-use-own-logging.patch \
%D%/packages/patches/libbonobo-activation-test-race.patch \
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index e634d6ab9..fab71d055 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -253,7 +253,8 @@ random access nor for in-place modification.")
(method url-fetch)
(uri (string-append "http://libarchive.org/downloads/libarchive-"
version ".tar.gz"))
- (patches (search-patches "libarchive-CVE-2017-14166.patch"))
+ (patches (search-patches "libarchive-CVE-2017-14166.patch"
+ "libarchive-CVE-2017-14502.patch"))
(sha256
(base32
"1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))))
diff --git a/gnu/packages/patches/libarchive-CVE-2017-14502.patch b/gnu/packages/patches/libarchive-CVE-2017-14502.patch
new file mode 100644
index 000000000..8e0508afb
--- /dev/null
+++ b/gnu/packages/patches/libarchive-CVE-2017-14502.patch
@@ -0,0 +1,40 @@
+Fix CVE-2017-14502:
+
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14502
+https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=573
+
+Patch copied from upstream source repository:
+
+https://github.com/libarchive/libarchive/commit/5562545b5562f6d12a4ef991fae158bf4ccf92b6
+
+From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001
+From: Joerg Sonnenberger <joerg@bec.de>
+Date: Sat, 9 Sep 2017 17:47:32 +0200
+Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR
+ archives.
+
+Reported-By: OSS-Fuzz issue 573
+---
+ libarchive/archive_read_support_format_rar.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
+index cbb14c32..751de697 100644
+--- a/libarchive/archive_read_support_format_rar.c
++++ b/libarchive/archive_read_support_format_rar.c
+@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry,
+ return (ARCHIVE_FATAL);
+ }
+ filename[filename_size++] = '\0';
+- filename[filename_size++] = '\0';
++ /*
++ * Do not increment filename_size here as the computations below
++ * add the space for the terminating NUL explicitly.
++ */
++ filename[filename_size] = '\0';
+
+ /* Decoded unicode form is UTF-16BE, so we have to update a string
+ * conversion object for it. */
+--
+2.15.1
+
--
2.15.1
next reply other threads:[~2017-12-21 0:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-21 0:43 Leo Famulari [this message]
2017-12-21 10:12 ` [bug#29793] [PATCH] gnu: libarchive: Fix CVE-2017-14502 Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b2a07b42fc8d1ec284f33d3d5940117c2402d196.1513816998.git.leo@famulari.name \
--to=leo@famulari.name \
--cc=29793@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.