diff -Nru cpio-2.11+dfsg/debian/changelog cpio-2.11+dfsg/debian/changelog --- cpio-2.11+dfsg/debian/changelog 2015-03-08 09:31:22.000000000 +0000 +++ cpio-2.11+dfsg/debian/changelog 2017-06-16 15:35:18.000000000 +0000 @@ -1,3 +1,13 @@ +cpio (2.11+dfsg-4.1ubuntu1.15.04.1) vivid-security; urgency=medium + + [ Marc Deslauriers ] + * SECURITY UPDATE: out-of-bounds write + - debian/patches/CVE-2016-2037.patch: make sure there is at least two + bytes available in src/copyin.c, added comment to src/util.c. + - CVE-2016-2037 + + -- Emily Ratliff Thu, 15 Jun 2017 14:42:42 -0500 + cpio (2.11+dfsg-4.1ubuntu1) vivid; urgency=medium * Resynchronise with Debian. Remaining changes: diff -Nru cpio-2.11+dfsg/debian/patches/CVE-2016-2037.patch cpio-2.11+dfsg/debian/patches/CVE-2016-2037.patch --- cpio-2.11+dfsg/debian/patches/CVE-2016-2037.patch 1970-01-01 00:00:00.000000000 +0000 +++ cpio-2.11+dfsg/debian/patches/CVE-2016-2037.patch 2017-06-15 19:42:14.000000000 +0000 @@ -0,0 +1,48 @@ +Description: fix 1-byte out-of-bounds write (CVE-2016-2037) + Other calls to cpio_safer_name_suffix seem to be safe. + . + * src/copyin.c (process_copy_in): Make sure that file_hdr.c_name + has at least two bytes allocated. + * src/util.c (cpio_safer_name_suffix): Document that use of this + function requires to be careful. +Origin: upstream, https://lists.gnu.org/archive/html/bug-cpio/2016-01/msg00005.html +Bug-Debian: https://bugs.debian.org/812401 +Forwarded: not-needed +Author: Pavel Raiskup +Reviewed-by: Salvatore Bonaccorso +Last-Update: 2016-02-12 + +--- + src/copyin.c | 2 ++ + src/util.c | 5 ++++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +Index: cpio-2.11+dfsg/src/copyin.c +=================================================================== +--- cpio-2.11+dfsg.orig/src/copyin.c ++++ cpio-2.11+dfsg/src/copyin.c +@@ -1433,6 +1433,8 @@ process_copy_in () + break; + } + ++ if (file_hdr.c_namesize <= 1) ++ file_hdr.c_name = xrealloc(file_hdr.c_name, 2); + cpio_safer_name_suffix (file_hdr.c_name, false, !no_abs_paths_flag, + false); + +Index: cpio-2.11+dfsg/src/util.c +=================================================================== +--- cpio-2.11+dfsg.orig/src/util.c ++++ cpio-2.11+dfsg/src/util.c +@@ -1374,7 +1374,10 @@ set_file_times (int fd, + } + + /* Do we have to ignore absolute paths, and if so, does the filename +- have an absolute path? */ ++ have an absolute path? ++ Before calling this function make sure that the allocated NAME buffer has ++ capacity at least 2 bytes to allow us to store the "." string inside. */ ++ + void + cpio_safer_name_suffix (char *name, bool link_target, bool absolute_names, + bool strip_leading_dots) diff -Nru cpio-2.11+dfsg/debian/patches/series cpio-2.11+dfsg/debian/patches/series --- cpio-2.11+dfsg/debian/patches/series 2015-03-05 10:49:50.000000000 +0000 +++ cpio-2.11+dfsg/debian/patches/series 2017-06-15 19:42:14.000000000 +0000 @@ -17,3 +17,4 @@ fd262d11.patch f6a8a2cb.patch CVE-2015-1197.patch +CVE-2016-2037.patch