diff options
Diffstat (limited to 'poky/meta/recipes-extended')
10 files changed, 477 insertions, 3 deletions
diff --git a/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb b/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb index de668d6d2..acbf80a68 100644 --- a/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb +++ b/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb @@ -2,13 +2,13 @@ SUMMARY = "Very high-quality data compression program" DESCRIPTION = "bzip2 compresses files using the Burrows-Wheeler block-sorting text compression algorithm, and \ Huffman coding. Compression is generally considerably better than that achieved by more conventional \ LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors." -HOMEPAGE = "http://www.bzip.org/" +HOMEPAGE = "https://sourceware.org/bzip2/" SECTION = "console/utils" LICENSE = "bzip2" LIC_FILES_CHKSUM = "file://LICENSE;beginline=8;endline=37;md5=40d9d1eb05736d1bfc86cfdd9106e6b2" PR = "r5" -SRC_URI = "http://www.bzip.org/${PV}/${BP}.tar.gz \ +SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/${BP}.tar.gz \ file://fix-bunzip2-qt-returns-0-for-corrupt-archives.patch \ file://configure.ac;subdir=${BP} \ file://Makefile.am;subdir=${BP} \ @@ -19,7 +19,7 @@ SRC_URI = "http://www.bzip.org/${PV}/${BP}.tar.gz \ SRC_URI[md5sum] = "00b516f4704d4a7cb50a1d97e6e8e15b" SRC_URI[sha256sum] = "a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd" -UPSTREAM_CHECK_URI = "http://www.bzip.org/downloads.html" +UPSTREAM_CHECK_URI = "https://www.sourceware.org/bzip2/" PACKAGES =+ "libbz2" diff --git a/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14503.patch b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14503.patch new file mode 100644 index 000000000..42fa68cae --- /dev/null +++ b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14503.patch @@ -0,0 +1,33 @@ +From 2c8c83b9731ff822fad6cc8c670ea5519c366a14 Mon Sep 17 00:00:00 2001 +From: Joerg Sonnenberger <joerg@bec.de> +Date: Thu, 19 Jul 2018 21:14:53 +0200 +Subject: [PATCH] Reject LHA archive entries with negative size. + +CVE: CVE-2017-14503 +Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/2c8c83b9731ff822fad6cc8c670ea5519c366a14] + +Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com> +--- + libarchive/archive_read_support_format_lha.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c +index b8ef4ae1..95c99bb1 100644 +--- a/libarchive/archive_read_support_format_lha.c ++++ b/libarchive/archive_read_support_format_lha.c +@@ -701,6 +701,12 @@ archive_read_format_lha_read_header(struct archive_read *a, + * Prepare variables used to read a file content. + */ + lha->entry_bytes_remaining = lha->compsize; ++ if (lha->entry_bytes_remaining < 0) { ++ archive_set_error(&a->archive, ++ ARCHIVE_ERRNO_FILE_FORMAT, ++ "Invalid LHa entry size"); ++ return (ARCHIVE_FATAL); ++ } + lha->entry_offset = 0; + lha->entry_crc_calculated = 0; + +-- +2.13.3 + diff --git a/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb b/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb index 5daca2731..326971647 100644 --- a/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb +++ b/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb @@ -36,6 +36,7 @@ SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ file://CVE-2017-14166.patch \ file://CVE-2017-14502.patch \ file://non-recursive-extract-and-list.patch \ + file://CVE-2017-14503.patch \ " SRC_URI[md5sum] = "4583bd6b2ebf7e0e8963d90879eb1b27" diff --git a/poky/meta/recipes-extended/procps/procps/CVE-2018-1124.patch b/poky/meta/recipes-extended/procps/procps/CVE-2018-1124.patch new file mode 100644 index 000000000..bc78faf0d --- /dev/null +++ b/poky/meta/recipes-extended/procps/procps/CVE-2018-1124.patch @@ -0,0 +1,176 @@ +From bdd058a0e676d2f013027fcfb2b344c313112a50 Mon Sep 17 00:00:00 2001 +From: Qualys Security Advisory <qsa@qualys.com> +Date: Thu, 1 Jan 1970 00:00:00 +0000 +Subject: [PATCH 074/126] proc/readproc.c: Fix bugs and overflows in + file2strvec(). + +Note: this is by far the most important and complex patch of the whole +series, please review it carefully; thank you very much! + +For this patch, we decided to keep the original function's design and +skeleton, to avoid regressions and behavior changes, while fixing the +various bugs and overflows. And like the "Harden file2str()" patch, this +patch does not fail when about to overflow, but truncates instead: there +is information available about this process, so return it to the caller; +also, we used INT_MAX as a limit, but a lower limit could be used. + +The easy changes: + +- Replace sprintf() with snprintf() (and check for truncation). + +- Replace "if (n == 0 && rbuf == 0)" with "if (n <= 0 && tot <= 0)" and + do break instead of return: it simplifies the code (only one place to + handle errors), and also guarantees that in the while loop either n or + tot is > 0 (or both), even if n is reset to 0 when about to overflow. + +- Remove the "if (n < 0)" block in the while loop: it is (and was) dead + code, since we enter the while loop only if n >= 0. + +- Rewrite the missing-null-terminator detection: in the original + function, if the size of the file is a multiple of 2047, a null- + terminator is appended even if the file is already null-terminated. + +- Replace "if (n <= 0 && !end_of_file)" with "if (n < 0 || tot <= 0)": + originally, it was equivalent to "if (n < 0)", but we added "tot <= 0" + to handle the first break of the while loop, and to guarantee that in + the rest of the function tot is > 0. + +- Double-force ("belt and suspenders") the null-termination of rbuf: + this is (and was) essential to the correctness of the function. + +- Replace the final "while" loop with a "for" loop that behaves just + like the preceding "for" loop: in the original function, this would + lead to unexpected results (for example, if rbuf is |\0|A|\0|, this + would return the array {"",NULL} but should return {"","A",NULL}; and + if rbuf is |A|\0|B| (should never happen because rbuf should be null- + terminated), this would make room for two pointers in ret, but would + write three pointers to ret). + +The hard changes: + +- Prevent the integer overflow of tot in the while loop, but unlike + file2str(), file2strvec() cannot let tot grow until it almost reaches + INT_MAX, because it needs more space for the pointers: this is why we + introduced ARG_LEN, which also guarantees that we can add "align" and + a few sizeof(char*)s to tot without overflowing. + +- Prevent the integer overflow of "tot + c + align": when INT_MAX is + (almost) reached, we write the maximal safe amount of pointers to ret + (ARG_LEN guarantees that there is always space for *ret = rbuf and the + NULL terminator). +[carnil: backport for 3.3.9: Add include for limits.h and use of MAX_INT] + +CVE: CVE-2018-1124 +Upstream-Status: Backport [https://gitlab.com/procps-ng/procps/commit/36c350f07c75aabf747fb833f52a234ae5781b20] + +Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com> +--- + proc/readproc.c | 53 ++++++++++++++++++++++++++++++++--------------------- + 1 file changed, 32 insertions(+), 21 deletions(-) + +diff -Naurp procps-ng-3.3.12_org/proc/readproc.c procps-ng-3.3.12/proc/readproc.c +--- procps-ng-3.3.12_org/proc/readproc.c 2016-07-09 14:49:25.825306872 -0700 ++++ procps-ng-3.3.12/proc/readproc.c 2018-07-24 00:46:49.366202531 -0700 +@@ -37,6 +37,7 @@ + #include <dirent.h> + #include <sys/types.h> + #include <sys/stat.h> ++#include <limits.h> + #ifdef WITH_SYSTEMD + #include <systemd/sd-login.h> + #endif +--- a/proc/readproc.c ++++ b/proc/readproc.c +@@ -600,11 +601,12 @@ static int file2str(const char *director + + static char** file2strvec(const char* directory, const char* what) { + char buf[2048]; /* read buf bytes at a time */ +- char *p, *rbuf = 0, *endbuf, **q, **ret; ++ char *p, *rbuf = 0, *endbuf, **q, **ret, *strp; + int fd, tot = 0, n, c, end_of_file = 0; + int align; + +- sprintf(buf, "%s/%s", directory, what); ++ const int len = snprintf(buf, sizeof buf, "%s/%s", directory, what); ++ if(len <= 0 || (size_t)len >= sizeof buf) return NULL; + fd = open(buf, O_RDONLY, 0); + if(fd==-1) return NULL; + +@@ -612,18 +614,23 @@ static char** file2strvec(const char* di + while ((n = read(fd, buf, sizeof buf - 1)) >= 0) { + if (n < (int)(sizeof buf - 1)) + end_of_file = 1; +- if (n == 0 && rbuf == 0) { +- close(fd); +- return NULL; /* process died between our open and read */ ++ if (n <= 0 && tot <= 0) { /* nothing read now, nothing read before */ ++ break; /* process died between our open and read */ + } +- if (n < 0) { +- if (rbuf) +- free(rbuf); +- close(fd); +- return NULL; /* read error */ ++ /* ARG_LEN is our guesstimated median length of a command-line argument ++ or environment variable (the minimum is 1, the maximum is 131072) */ ++ #define ARG_LEN 64 ++ if (tot >= INT_MAX / (ARG_LEN + (int)sizeof(char*)) * ARG_LEN - n) { ++ end_of_file = 1; /* integer overflow: null-terminate and break */ ++ n = 0; /* but tot > 0 */ + } +- if (end_of_file && (n == 0 || buf[n-1]))/* last read char not null */ ++ #undef ARG_LEN ++ if (end_of_file && ++ ((n > 0 && buf[n-1] != '\0') || /* last read char not null */ ++ (n <= 0 && rbuf[tot-1] != '\0'))) /* last read char not null */ + buf[n++] = '\0'; /* so append null-terminator */ ++ ++ if (n <= 0) break; /* unneeded (end_of_file = 1) but avoid realloc */ + rbuf = xrealloc(rbuf, tot + n); /* allocate more memory */ + memcpy(rbuf + tot, buf, n); /* copy buffer into it */ + tot += n; /* increment total byte ctr */ +@@ -631,29 +638,34 @@ static char** file2strvec(const char* di + break; + } + close(fd); +- if (n <= 0 && !end_of_file) { ++ if (n < 0 || tot <= 0) { /* error, or nothing read */ + if (rbuf) free(rbuf); + return NULL; /* read error */ + } ++ rbuf[tot-1] = '\0'; /* belt and suspenders (the while loop did it, too) */ + endbuf = rbuf + tot; /* count space for pointers */ + align = (sizeof(char*)-1) - ((tot + sizeof(char*)-1) & (sizeof(char*)-1)); +- for (c = 0, p = rbuf; p < endbuf; p++) { +- if (!*p || *p == '\n') ++ c = sizeof(char*); /* one extra for NULL term */ ++ for (p = rbuf; p < endbuf; p++) { ++ if (!*p || *p == '\n') { ++ if (c >= INT_MAX - (tot + (int)sizeof(char*) + align)) break; + c += sizeof(char*); ++ } + if (*p == '\n') + *p = 0; + } +- c += sizeof(char*); /* one extra for NULL term */ + + rbuf = xrealloc(rbuf, tot + c + align); /* make room for ptrs AT END */ + endbuf = rbuf + tot; /* addr just past data buf */ + q = ret = (char**) (endbuf+align); /* ==> free(*ret) to dealloc */ +- *q++ = p = rbuf; /* point ptrs to the strings */ +- endbuf--; /* do not traverse final NUL */ +- while (++p < endbuf) +- if (!*p) /* NUL char implies that */ +- *q++ = p+1; /* next string -> next char */ +- ++ for (strp = p = rbuf; p < endbuf; p++) { ++ if (!*p) { /* NUL char implies that */ ++ if (c < 2 * (int)sizeof(char*)) break; ++ c -= sizeof(char*); ++ *q++ = strp; /* point ptrs to the strings */ ++ strp = p+1; /* next string -> next char */ ++ } ++ } + *q = 0; /* null ptr list terminator */ + return ret; + } diff --git a/poky/meta/recipes-extended/procps/procps_3.3.12.bb b/poky/meta/recipes-extended/procps/procps_3.3.12.bb index ecf215fec..6e15b0a5a 100644 --- a/poky/meta/recipes-extended/procps/procps_3.3.12.bb +++ b/poky/meta/recipes-extended/procps/procps_3.3.12.bb @@ -14,6 +14,7 @@ inherit autotools gettext pkgconfig update-alternatives SRC_URI = "http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-${PV}.tar.xz \ file://sysctl.conf \ + file://CVE-2018-1124.patch \ " SRC_URI[md5sum] = "957e42e8b193490b2111252e4a2b443c" diff --git a/poky/meta/recipes-extended/shadow/files/CVE-2018-7169.patch b/poky/meta/recipes-extended/shadow/files/CVE-2018-7169.patch new file mode 100644 index 000000000..36887d44e --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/CVE-2018-7169.patch @@ -0,0 +1,186 @@ +From fb28c99b8a66ff2605c5cb96abc0a4d975f92de0 Mon Sep 17 00:00:00 2001 +From: Aleksa Sarai <asarai@suse.de> +Date: Thu, 15 Feb 2018 23:49:40 +1100 +Subject: [PATCH] newgidmap: enforce setgroups=deny if self-mapping a group + +This is necessary to match the kernel-side policy of "self-mapping in a +user namespace is fine, but you cannot drop groups" -- a policy that was +created in order to stop user namespaces from allowing trivial privilege +escalation by dropping supplementary groups that were "blacklisted" from +certain paths. + +This is the simplest fix for the underlying issue, and effectively makes +it so that unless a user has a valid mapping set in /etc/subgid (which +only administrators can modify) -- and they are currently trying to use +that mapping -- then /proc/$pid/setgroups will be set to deny. This +workaround is only partial, because ideally it should be possible to set +an "allow_setgroups" or "deny_setgroups" flag in /etc/subgid to allow +administrators to further restrict newgidmap(1). + +We also don't write anything in the "allow" case because "allow" is the +default, and users may have already written "deny" even if they +technically are allowed to use setgroups. And we don't write anything if +the setgroups policy is already "deny". + +Ref: https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1729357 +Fixes: CVE-2018-7169 + +Upstream-Status: Backport [https://github.com/shadow-maint/shadow/commit/fb28c99b8a66ff2605c5cb96abc0a4d975f92de0] +Reported-by: Craig Furman <craig.furman89@gmail.com> +Signed-off-by: Aleksa Sarai <asarai@suse.de> +Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com> +--- + src/newgidmap.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 80 insertions(+), 9 deletions(-) + +diff --git a/src/newgidmap.c b/src/newgidmap.c +index b1e33513..59a2e75c 100644 +--- a/src/newgidmap.c ++++ b/src/newgidmap.c +@@ -46,32 +46,37 @@ + */ + const char *Prog; + +-static bool verify_range(struct passwd *pw, struct map_range *range) ++ ++static bool verify_range(struct passwd *pw, struct map_range *range, bool *allow_setgroups) + { + /* An empty range is invalid */ + if (range->count == 0) + return false; + +- /* Test /etc/subgid */ +- if (have_sub_gids(pw->pw_name, range->lower, range->count)) ++ /* Test /etc/subgid. If the mapping is valid then we allow setgroups. */ ++ if (have_sub_gids(pw->pw_name, range->lower, range->count)) { ++ *allow_setgroups = true; + return true; ++ } + +- /* Allow a process to map it's own gid */ +- if ((range->count == 1) && (pw->pw_gid == range->lower)) ++ /* Allow a process to map its own gid. */ ++ if ((range->count == 1) && (pw->pw_gid == range->lower)) { ++ /* noop -- if setgroups is enabled already we won't disable it. */ + return true; ++ } + + return false; + } + + static void verify_ranges(struct passwd *pw, int ranges, +- struct map_range *mappings) ++ struct map_range *mappings, bool *allow_setgroups) + { + struct map_range *mapping; + int idx; + + mapping = mappings; + for (idx = 0; idx < ranges; idx++, mapping++) { +- if (!verify_range(pw, mapping)) { ++ if (!verify_range(pw, mapping, allow_setgroups)) { + fprintf(stderr, _( "%s: gid range [%lu-%lu) -> [%lu-%lu) not allowed\n"), + Prog, + mapping->upper, +@@ -89,6 +94,70 @@ static void usage(void) + exit(EXIT_FAILURE); + } + ++void write_setgroups(int proc_dir_fd, bool allow_setgroups) ++{ ++ int setgroups_fd; ++ char *policy, policy_buffer[4096]; ++ ++ /* ++ * Default is "deny", and any "allow" will out-rank a "deny". We don't ++ * forcefully write an "allow" here because the process we are writing ++ * mappings for may have already set themselves to "deny" (and "allow" ++ * is the default anyway). So allow_setgroups == true is a noop. ++ */ ++ policy = "deny\n"; ++ if (allow_setgroups) ++ return; ++ ++ setgroups_fd = openat(proc_dir_fd, "setgroups", O_RDWR|O_CLOEXEC); ++ if (setgroups_fd < 0) { ++ /* ++ * If it's an ENOENT then we are on too old a kernel for the setgroups ++ * code to exist. Emit a warning and bail on this. ++ */ ++ if (ENOENT == errno) { ++ fprintf(stderr, _("%s: kernel doesn't support setgroups restrictions\n"), Prog); ++ goto out; ++ } ++ fprintf(stderr, _("%s: couldn't open process setgroups: %s\n"), ++ Prog, ++ strerror(errno)); ++ exit(EXIT_FAILURE); ++ } ++ ++ /* ++ * Check whether the policy is already what we want. /proc/self/setgroups ++ * is write-once, so attempting to write after it's already written to will ++ * fail. ++ */ ++ if (read(setgroups_fd, policy_buffer, sizeof(policy_buffer)) < 0) { ++ fprintf(stderr, _("%s: failed to read setgroups: %s\n"), ++ Prog, ++ strerror(errno)); ++ exit(EXIT_FAILURE); ++ } ++ if (!strncmp(policy_buffer, policy, strlen(policy))) ++ goto out; ++ ++ /* Write the policy. */ ++ if (lseek(setgroups_fd, 0, SEEK_SET) < 0) { ++ fprintf(stderr, _("%s: failed to seek setgroups: %s\n"), ++ Prog, ++ strerror(errno)); ++ exit(EXIT_FAILURE); ++ } ++ if (dprintf(setgroups_fd, "%s", policy) < 0) { ++ fprintf(stderr, _("%s: failed to setgroups %s policy: %s\n"), ++ Prog, ++ policy, ++ strerror(errno)); ++ exit(EXIT_FAILURE); ++ } ++ ++out: ++ close(setgroups_fd); ++} ++ + /* + * newgidmap - Set the gid_map for the specified process + */ +@@ -103,6 +172,7 @@ int main(int argc, char **argv) + struct stat st; + struct passwd *pw; + int written; ++ bool allow_setgroups = false; + + Prog = Basename (argv[0]); + +@@ -145,7 +215,7 @@ int main(int argc, char **argv) + (unsigned long) getuid ())); + return EXIT_FAILURE; + } +- ++ + /* Get the effective uid and effective gid of the target process */ + if (fstat(proc_dir_fd, &st) < 0) { + fprintf(stderr, _("%s: Could not stat directory for target %u\n"), +@@ -177,8 +247,9 @@ int main(int argc, char **argv) + if (!mappings) + usage(); + +- verify_ranges(pw, ranges, mappings); ++ verify_ranges(pw, ranges, mappings, &allow_setgroups); + ++ write_setgroups(proc_dir_fd, allow_setgroups); + write_mapping(proc_dir_fd, ranges, mappings, "gid_map"); + sub_gid_close(); + +-- +2.13.3 + diff --git a/poky/meta/recipes-extended/shadow/shadow.inc b/poky/meta/recipes-extended/shadow/shadow.inc index 6efe4a911..9691c3879 100644 --- a/poky/meta/recipes-extended/shadow/shadow.inc +++ b/poky/meta/recipes-extended/shadow/shadow.inc @@ -20,6 +20,7 @@ SRC_URI = "https://downloads.yoctoproject.org/mirror/sources/${BP}.tar.xz \ file://0001-shadow-CVE-2017-12424 \ file://CVE-2017-2616.patch \ ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \ + file://CVE-2018-7169.patch \ " SRC_URI_append_class-target = " \ diff --git a/poky/meta/recipes-extended/unzip/unzip/0001-unzip-fix-CVE-2018-1000035.patch b/poky/meta/recipes-extended/unzip/unzip/0001-unzip-fix-CVE-2018-1000035.patch new file mode 100644 index 000000000..37289d1a5 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/0001-unzip-fix-CVE-2018-1000035.patch @@ -0,0 +1,48 @@ +From 349f566e6e757458843fa164a0f0584280e1501e Mon Sep 17 00:00:00 2001 +From: Changqing Li <changqing.li@windriver.com> +Date: Wed, 15 Aug 2018 16:20:53 +0800 +Subject: [PATCH] unzip: fix CVE-2018-1000035 + +Upstream-Status: Backport + +CVE: CVE-2018-1000035 + +backport from unzip6.10c23 + +Signed-off-by: Changqing Li <changqing.li@windriver.com> +--- + fileio.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/fileio.c b/fileio.c +index 36bfea3..7605a29 100644 +--- a/fileio.c ++++ b/fileio.c +@@ -1582,6 +1582,8 @@ int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn) + int r = IZ_PW_ENTERED; + char *m; + char *prompt; ++ char *ep; ++ char *zp; + + #ifndef REENTRANT + /* tell picky compilers to shut up about "unused variable" warnings */ +@@ -1590,9 +1592,12 @@ int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn) + + if (*rcnt == 0) { /* First call for current entry */ + *rcnt = 2; +- if ((prompt = (char *)malloc(2*FILNAMSIZ + 15)) != (char *)NULL) { +- sprintf(prompt, LoadFarString(PasswPrompt), +- FnFilter1(zfn), FnFilter2(efn)); ++ zp = FnFilter1( zfn); ++ ep = FnFilter2( efn); ++ prompt = (char *)malloc( /* Slightly too long (2* "%s"). */ ++ sizeof( PasswPrompt)+ strlen( zp)+ strlen( ep)); ++ if (prompt != (char *)NULL) { ++ sprintf(prompt, LoadFarString(PasswPrompt), zp, ep); + m = prompt; + } else + m = (char *)LoadFarString(PasswPrompt2); +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/unzip/unzip/symlink.patch b/poky/meta/recipes-extended/unzip/unzip/symlink.patch new file mode 100644 index 000000000..a38f6f161 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/symlink.patch @@ -0,0 +1,26 @@ +Unzip doesn't handle large zip files well and crashes: + +"This only happens if you have more then 16k entries and when one of +the 16k entry infos is reused it happend to be previously used for +a symlink entry." + +This patch is taken from Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=972427) + +Upstream-Status: Pending (upstream is dead) +Signed-off-by: Ross Burton <ross.burton@intel.com> + +--- unzip60/process.c.sav 2013-06-09 12:08:57.070392264 +0200 ++++ unzip60/process.c 2013-06-09 12:10:08.641696988 +0200 +@@ -1751,6 +1751,12 @@ + = (G.crec.general_purpose_bit_flag & (1 << 11)) == (1 << 11); + #endif + ++#ifdef SYMLINKS ++ /* Initialize the symlink flag, may be set by the platform-specific ++ mapattr function. */ ++ G.pInfo->symlink = 0; ++#endif ++ + return PK_COOL; + + } /* end function process_cdir_file_hdr() */ diff --git a/poky/meta/recipes-extended/unzip/unzip_6.0.bb b/poky/meta/recipes-extended/unzip/unzip_6.0.bb index 105d048f5..a47491ea4 100644 --- a/poky/meta/recipes-extended/unzip/unzip_6.0.bb +++ b/poky/meta/recipes-extended/unzip/unzip_6.0.bb @@ -19,6 +19,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/ file://fix-security-format.patch \ file://18-cve-2014-9913-unzip-buffer-overflow.patch \ file://19-cve-2016-9844-zipinfo-buffer-overflow.patch \ + file://symlink.patch \ + file://0001-unzip-fix-CVE-2018-1000035.patch \ " UPSTREAM_VERSION_UNKNOWN = "1" |