diff options
author | jmbills <jason.m.bills@intel.com> | 2022-01-18 21:55:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 21:55:05 +0300 |
commit | 7cf0c1cd0ce835d1833509b7b911e8a97380278b (patch) | |
tree | 0b45c3beaa9874facc4ed1a2395a31e42be0135d /poky/meta/recipes-support | |
parent | 4dac5fcd49b5e2de1074f1363775ec0f19041072 (diff) | |
parent | 1fc0d70f658da30091bcd49f9bf29aecd6b99ba7 (diff) | |
download | openbmc-7cf0c1cd0ce835d1833509b7b911e8a97380278b.tar.xz |
Merge pull request #76 from Intel-BMC/update1-0.86
Update
Diffstat (limited to 'poky/meta/recipes-support')
18 files changed, 444 insertions, 13 deletions
diff --git a/poky/meta/recipes-support/apr/apr/CVE-2021-35940.patch b/poky/meta/recipes-support/apr/apr/CVE-2021-35940.patch new file mode 100644 index 000000000..00befdace --- /dev/null +++ b/poky/meta/recipes-support/apr/apr/CVE-2021-35940.patch @@ -0,0 +1,58 @@ + +SECURITY: CVE-2021-35940 (cve.mitre.org) + +Restore fix for CVE-2017-12613 which was missing in 1.7.x branch, though +was addressed in 1.6.x in 1.6.3 and later via r1807976. + +The fix was merged back to 1.7.x in r1891198. + +Since this was a regression in 1.7.0, a new CVE name has been assigned +to track this, CVE-2021-35940. + +Thanks to Iveta Cesalova <icesalov redhat.com> for reporting this issue. + +https://svn.apache.org/viewvc?view=revision&revision=1891198 + +Upstream-Status: Backport +CVE: CVE-2021-35940 +Signed-off-by: Armin Kuster <akuster@mvista.com> + + +Index: time/unix/time.c +=================================================================== +--- a/time/unix/time.c (revision 1891197) ++++ b/time/unix/time.c (revision 1891198) +@@ -142,6 +142,9 @@ + static const int dayoffset[12] = + {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; + ++ if (xt->tm_mon < 0 || xt->tm_mon >= 12) ++ return APR_EBADDATE; ++ + /* shift new year to 1st March in order to make leap year calc easy */ + + if (xt->tm_mon < 2) +Index: time/win32/time.c +=================================================================== +--- a/time/win32/time.c (revision 1891197) ++++ b/time/win32/time.c (revision 1891198) +@@ -54,6 +54,9 @@ + static const int dayoffset[12] = + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; + ++ if (tm->wMonth < 1 || tm->wMonth > 12) ++ return APR_EBADDATE; ++ + /* Note; the caller is responsible for filling in detailed tm_usec, + * tm_gmtoff and tm_isdst data when applicable. + */ +@@ -228,6 +231,9 @@ + static const int dayoffset[12] = + {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; + ++ if (xt->tm_mon < 0 || xt->tm_mon >= 12) ++ return APR_EBADDATE; ++ + /* shift new year to 1st March in order to make leap year calc easy */ + + if (xt->tm_mon < 2) diff --git a/poky/meta/recipes-support/apr/apr_1.7.0.bb b/poky/meta/recipes-support/apr/apr_1.7.0.bb index 08d9edf3c..5f8fd6a46 100644 --- a/poky/meta/recipes-support/apr/apr_1.7.0.bb +++ b/poky/meta/recipes-support/apr/apr_1.7.0.bb @@ -24,6 +24,7 @@ SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \ file://libtoolize_check.patch \ file://0001-Add-option-to-disable-timed-dependant-tests.patch \ file://autoconf270.patch \ + file://CVE-2021-35940.patch \ " SRC_URI[md5sum] = "7a14a83d664e87599ea25ff4432e48a7" diff --git a/poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb b/poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb index 3d28ba2a2..95ce97ef3 100644 --- a/poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb +++ b/poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb @@ -29,7 +29,7 @@ PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd polkit', d PACKAGECONFIG[pam] = "--enable-pam-module --with-pam-module-dir=${base_libdir}/security,--disable-pam-module,libpam" PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit" -PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--with-systemdsystemunitdir=" +PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}/,--with-systemdsystemunitdir=" FILES:${PN} += "${exec_prefix}/lib/ConsoleKit \ ${libdir}/ConsoleKit ${systemd_unitdir} ${base_libdir} \ diff --git a/poky/meta/recipes-support/gnupg/gnupg_2.3.1.bb b/poky/meta/recipes-support/gnupg/gnupg_2.3.1.bb index b8b0314d2..411ea9579 100644 --- a/poky/meta/recipes-support/gnupg/gnupg_2.3.1.bb +++ b/poky/meta/recipes-support/gnupg/gnupg_2.3.1.bb @@ -31,6 +31,7 @@ EXTRA_OECONF = "--disable-ldap \ --with-zlib=${STAGING_LIBDIR}/.. \ --with-bzip2=${STAGING_LIBDIR}/.. \ --with-readline=${STAGING_LIBDIR}/.. \ + --with-mailprog=${sbindir}/sendmail \ --enable-gpg-is-gpg2 \ " diff --git a/poky/meta/recipes-support/libevent/libevent/0003-test-mark-util-monotonic_prc_fallback-as-retriable.patch b/poky/meta/recipes-support/libevent/libevent/0003-test-mark-util-monotonic_prc_fallback-as-retriable.patch new file mode 100644 index 000000000..8a2c78983 --- /dev/null +++ b/poky/meta/recipes-support/libevent/libevent/0003-test-mark-util-monotonic_prc_fallback-as-retriable.patch @@ -0,0 +1,28 @@ +From d01a57a998798da977c470f3b8d6a457c1adb144 Mon Sep 17 00:00:00 2001 +From: Azat Khuzhin <azat@libevent.org> +Date: Sun, 19 Sep 2021 00:57:31 +0300 +Subject: [PATCH] test: mark util/monotonic_prc_fallback as retriable + +Refs: #1193 + +Upstream-status: Backported +--- + test/regress_util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/regress_util.c b/test/regress_util.c +index 45caa2700a40..a9e80db20149 100644 +--- a/test/regress_util.c ++++ b/test/regress_util.c +@@ -1672,7 +1672,7 @@ struct testcase_t util_testcases[] = { + { "monotonic_res_fallback", test_evutil_monotonic_res, TT_OFF_BY_DEFAULT, &basic_setup, (void*)"fallback" }, + { "monotonic_prc", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"" }, + { "monotonic_prc_precise", test_evutil_monotonic_prc, TT_RETRIABLE, &basic_setup, (void*)"precise" }, +- { "monotonic_prc_fallback", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"fallback" }, ++ { "monotonic_prc_fallback", test_evutil_monotonic_prc, TT_RETRIABLE, &basic_setup, (void*)"fallback" }, + { "date_rfc1123", test_evutil_date_rfc1123, 0, NULL, NULL }, + { "evutil_v4addr_is_local", test_evutil_v4addr_is_local, 0, NULL, NULL }, + { "evutil_v6addr_is_local", test_evutil_v6addr_is_local, 0, NULL, NULL }, +-- +2.31.1 + diff --git a/poky/meta/recipes-support/libevent/libevent/0004-test-retriable-tests-are-marked-failed-only-when-all-a.patch b/poky/meta/recipes-support/libevent/libevent/0004-test-retriable-tests-are-marked-failed-only-when-all-a.patch new file mode 100644 index 000000000..ae7db0b7a --- /dev/null +++ b/poky/meta/recipes-support/libevent/libevent/0004-test-retriable-tests-are-marked-failed-only-when-all-a.patch @@ -0,0 +1,81 @@ +From 36ebd92fa53c0097f1e2f9ec5aa5b5c6ec1b411d Mon Sep 17 00:00:00 2001 +From: Thomas Perrot <thomas.perrot@bootlin.com> +Date: Wed, 29 Sep 2021 13:50:35 +0200 +Subject: [PATCH] test: retriable tests are marked failed only when all + attempts have failed + +Fixes: #1193 + +Upstream-status: Pending + +Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> +--- + test/tinytest.c | 13 ++++++------- + test/tinytest.h | 2 +- + 2 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/test/tinytest.c b/test/tinytest.c +index 85dfe74a720e..bf2882418eb6 100644 +--- a/test/tinytest.c ++++ b/test/tinytest.c +@@ -310,7 +310,8 @@ testcase_run_forked_(const struct testgroup_t *group, + + int + testcase_run_one(const struct testgroup_t *group, +- const struct testcase_t *testcase) ++ const struct testcase_t *testcase, ++ const int test_attempts) + { + enum outcome outcome; + +@@ -348,7 +349,7 @@ testcase_run_one(const struct testgroup_t *group, + if (opt_verbosity>0 && !opt_forked) + puts("SKIPPED"); + } else { +- if (!opt_forked) ++ if (!opt_forked && (testcase->flags & TT_RETRIABLE) && !test_attempts) + printf("\n [%s FAILED]\n", testcase->name); + } + +@@ -525,22 +526,20 @@ tinytest_main(int c, const char **v, struct testgroup_t *groups) + struct testgroup_t *group = &groups[i]; + for (j = 0; group->cases[j].name; ++j) { + struct testcase_t *testcase = &group->cases[j]; +- int test_attempts = 3; ++ int test_attempts = (testcase->flags & TT_RETRIABLE) ? 3: 1; + int test_ret_err; + + if (!(testcase->flags & TT_ENABLED_)) + continue; + + for (;;) { +- test_ret_err = testcase_run_one(group, testcase); ++ test_ret_err = testcase_run_one(group, testcase, test_attempts); + + if (test_ret_err == OK) + break; +- if (!(testcase->flags & TT_RETRIABLE)) ++ if (!--test_attempts) + break; + printf("\n [RETRYING %s (%i)]\n", testcase->name, test_attempts); +- if (!test_attempts--) +- break; + } + + switch (test_ret_err) { +diff --git a/test/tinytest.h b/test/tinytest.h +index d321dd467542..c276b5339331 100644 +--- a/test/tinytest.h ++++ b/test/tinytest.h +@@ -92,7 +92,7 @@ char *tinytest_format_hex_(const void *, unsigned long); + tinytest_set_flag_(groups, named, 1, TT_SKIP) + + /** Run a single testcase in a single group. */ +-int testcase_run_one(const struct testgroup_t *,const struct testcase_t *); ++int testcase_run_one(const struct testgroup_t *,const struct testcase_t *, const int test_attempts); + + void tinytest_set_aliases(const struct testlist_alias_t *aliases); + +-- +2.31.1 + diff --git a/poky/meta/recipes-support/libevent/libevent/run-ptest b/poky/meta/recipes-support/libevent/libevent/run-ptest index d3b5e793c..ef4260d1c 100644 --- a/poky/meta/recipes-support/libevent/libevent/run-ptest +++ b/poky/meta/recipes-support/libevent/libevent/run-ptest @@ -1,14 +1,14 @@ #!/bin/sh # run-ptest - 'ptest' test infrastructure shell script that -# wraps the libevent test scripts +# wraps the libevent test scripts # # Trevor Gamblin <trevor.gamblin@windriver.com> ############################################################### LIBEVENTLIB=@libdir@/libevent LOG="${LIBEVENTLIB}/ptest/libevent_ptest_$(date +%Y%m%d-%H%M%S).log" -cd ${LIBEVENTLIB}/ptest +cd ${LIBEVENTLIB}/ptest # Run only the libevent "regress" test. All other test scripts in the # libevent "test" folder are related to performance, e.g. read/write @@ -16,9 +16,9 @@ cd ${LIBEVENTLIB}/ptest # in the ptest log. ./test/regress 2>&1| sed -e '/TESTS/d' -e '/tests/d' -e '/OK/ s/^/PASS: / ; /FAILED/ s/^/FAIL: / ; /SKIPPED/ s/^/SKIP: / ; /DISABLED/ s/^/SKIP: /' | cut -f1,2 -d ':' | tee -a ${LOG} -passed=`grep PASS ${LOG}|wc -l` -failed=`grep FAIL ${LOG}|wc -l` -skipped=`grep -E SKIP ${LOG}|wc -l` +passed=`grep PASS: ${LOG}|wc -l` +failed=`grep FAIL: ${LOG}|wc -l` +skipped=`grep -E SKIP: ${LOG}|wc -l` all=$((passed + failed + skipped)) ( echo "=== Test Summary ===" diff --git a/poky/meta/recipes-support/libevent/libevent_2.1.12.bb b/poky/meta/recipes-support/libevent/libevent_2.1.12.bb index 2a562fe2e..e26e8a9b5 100644 --- a/poky/meta/recipes-support/libevent/libevent_2.1.12.bb +++ b/poky/meta/recipes-support/libevent/libevent_2.1.12.bb @@ -8,7 +8,7 @@ HOMEPAGE = "http://libevent.org/" BUGTRACKER = "https://github.com/libevent/libevent/issues" SECTION = "libs" -LICENSE = "BSD & MIT" +LICENSE = "BSD-3-Clause & MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=17f20574c0b154d12236d5fbe964f549" SRC_URI = "https://github.com/libevent/libevent/releases/download/release-${PV}-stable/${BP}-stable.tar.gz \ @@ -16,6 +16,8 @@ SRC_URI = "https://github.com/libevent/libevent/releases/download/release-${PV}- file://run-ptest \ file://0001-test-regress_dns.c-patch-out-tests-that-require-a-wo.patch \ file://0002-test-regress.h-Increase-default-timeval-tolerance-50.patch \ + file://0003-test-mark-util-monotonic_prc_fallback-as-retriable.patch \ + file://0004-test-retriable-tests-are-marked-failed-only-when-all-a.patch \ " SRC_URI[sha256sum] = "92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb" @@ -56,7 +58,7 @@ do_install_ptest() { do install -m 0755 $file ${D}${PTEST_PATH}/test done - + # handle multilib sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest } diff --git a/poky/meta/recipes-support/libgcrypt/libgcrypt_1.9.3.bb b/poky/meta/recipes-support/libgcrypt/libgcrypt_1.9.4.bb index dee936dbc..4bc1dd851 100644 --- a/poky/meta/recipes-support/libgcrypt/libgcrypt_1.9.3.bb +++ b/poky/meta/recipes-support/libgcrypt/libgcrypt_1.9.4.bb @@ -27,7 +27,7 @@ SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \ file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \ file://0001-Makefile.am-add-a-missing-space.patch \ " -SRC_URI[sha256sum] = "97ebe4f94e2f7e35b752194ce15a0f3c66324e0ff6af26659bbfb5ff2ec328fd" +SRC_URI[sha256sum] = "ea849c83a72454e3ed4267697e8ca03390aee972ab421e7df69dfe42b65caaf7" # Below whitelisted CVEs are disputed and not affecting crypto libraries for any distro. CVE_CHECK_WHITELIST += "CVE-2018-12433 CVE-2018-12438" diff --git a/poky/meta/recipes-support/libsoup/libsoup-2.4_2.72.0.bb b/poky/meta/recipes-support/libsoup/libsoup-2.4_2.72.0.bb index 314989646..e888202b7 100644 --- a/poky/meta/recipes-support/libsoup/libsoup-2.4_2.72.0.bb +++ b/poky/meta/recipes-support/libsoup/libsoup-2.4_2.72.0.bb @@ -7,7 +7,7 @@ SECTION = "x11/gnome/libs" LICENSE = "LGPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" -DEPENDS = "glib-2.0 glib-2.0-native libxml2 sqlite3 intltool-native libpsl" +DEPENDS = "glib-2.0 glib-2.0-native libxml2 sqlite3 libpsl" SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" diff --git a/poky/meta/recipes-support/lz4/lz4_1.9.3.bb b/poky/meta/recipes-support/lz4/lz4_1.9.3.bb index 74f6743b9..b22eea315 100644 --- a/poky/meta/recipes-support/lz4/lz4_1.9.3.bb +++ b/poky/meta/recipes-support/lz4/lz4_1.9.3.bb @@ -2,7 +2,7 @@ SUMMARY = "Extremely Fast Compression algorithm" DESCRIPTION = "LZ4 is a very fast lossless compression algorithm, providing compression speed at 400 MB/s per core, scalable with multi-cores CPU. It also features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems." HOMEPAGE = "https://github.com/lz4/lz4" -LICENSE = "BSD | BSD-2-Clause | GPL-2.0" +LICENSE = "BSD-2-Clause | GPL-2.0" LIC_FILES_CHKSUM = "file://lib/LICENSE;md5=ebc2ea4814a64de7708f1571904b32cc \ file://programs/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ file://LICENSE;md5=d57c0d21cb917fb4e0af2454aa48b956 \ diff --git a/poky/meta/recipes-support/ptest-runner/ptest-runner_2.4.1.bb b/poky/meta/recipes-support/ptest-runner/ptest-runner_2.4.2.bb index c6a1ab178..1d3c24a17 100644 --- a/poky/meta/recipes-support/ptest-runner/ptest-runner_2.4.1.bb +++ b/poky/meta/recipes-support/ptest-runner/ptest-runner_2.4.2.bb @@ -7,7 +7,7 @@ HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/ptest-runner2/about/" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" -SRCREV = "cce0edb4282ee081d043030bfdf29f3e4052f86c" +SRCREV = "bcb82804daa8f725b6add259dcef2067e61a75aa" PV .= "+git${SRCPV}" SRC_URI = "git://git.yoctoproject.org/ptest-runner2 \ diff --git a/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service b/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service index 0559b9799..568686e80 100644 --- a/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service +++ b/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service @@ -3,6 +3,7 @@ Description=Hardware RNG Entropy Gatherer Daemon DefaultDependencies=no After=systemd-udev-settle.service Before=sysinit.target shutdown.target +Wants=systemd-udev-settle.service Conflicts=shutdown.target [Service] diff --git a/poky/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb b/poky/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb index 714aca62f..b2b830cc1 100644 --- a/poky/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb +++ b/poky/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb @@ -1,5 +1,5 @@ SUMMARY = "Shared MIME type database and specification" -DESCRIPTION = "The shared-mime-info package contains the core database of common types and the update-mime-database command used to extend it. It requires glib2 to be installed for building the update command. Additionally, it uses intltool for translations, though this is only a dependency for the maintainers." +DESCRIPTION = "The shared-mime-info package contains the core database of common types." HOMEPAGE = "http://freedesktop.org/wiki/Software/shared-mime-info" SECTION = "base" diff --git a/poky/meta/recipes-support/sqlite/sqlite3_3.36.0.bb b/poky/meta/recipes-support/sqlite/sqlite3_3.36.0.bb index f5d75e8e4..30c9445be 100644 --- a/poky/meta/recipes-support/sqlite/sqlite3_3.36.0.bb +++ b/poky/meta/recipes-support/sqlite/sqlite3_3.36.0.bb @@ -10,3 +10,5 @@ SRC_URI[sha256sum] = "bd90c3eb96bee996206b83be7065c9ce19aef38c3f4fb53073ada0d0b6 CVE_CHECK_WHITELIST += "CVE-2019-19242" # This is believed to be iOS specific (https://groups.google.com/g/sqlite-dev/c/U7OjAbZO6LA) CVE_CHECK_WHITELIST += "CVE-2015-3717" +# Issue in an experimental extension we don't have/use. Fixed by https://sqlite.org/src/info/b1e0c22ec981cf5f +CVE_CHECK_WHITELIST += "CVE-2021-36690" diff --git a/poky/meta/recipes-support/vim/files/CVE-2021-3778.patch b/poky/meta/recipes-support/vim/files/CVE-2021-3778.patch new file mode 100644 index 000000000..769a7a07a --- /dev/null +++ b/poky/meta/recipes-support/vim/files/CVE-2021-3778.patch @@ -0,0 +1,46 @@ +From eb41373c8c88b0789e5cf04669d6116f9a199264 Mon Sep 17 00:00:00 2001 +From: Minjae Kim <flowergom@gmail.com> +Date: Sun, 26 Sep 2021 23:48:00 +0000 +Subject: [PATCH] patch 8.2.3409: reading beyond end of line with invalid utf-8 + character + +Problem: Reading beyond end of line with invalid utf-8 character. +Solution: Check for NUL when advancing. + +Upstream-Status: Accepted [https://github.com/vim/vim/commit/65b605665997fad54ef39a93199e305af2fe4d7f] +CVE: CVE-2021-3778 +Signed-off-by: Minjae Kim <flowergom@gmail.com> +--- + src/regexp_nfa.c | 3 ++- + src/testdir/test_regexp_utf8.vim | 7 +++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +Index: git/src/regexp_nfa.c +=================================================================== +--- git.orig/src/regexp_nfa.c ++++ git/src/regexp_nfa.c +@@ -5455,7 +5455,8 @@ find_match_text(colnr_T startcol, int re + match = FALSE; + break; + } +- len2 += MB_CHAR2LEN(c2); ++ len2 += enc_utf8 ? utf_ptr2len(rex.line + col + len2) ++ : MB_CHAR2LEN(c2); + } + if (match + // check that no composing char follows +Index: git/src/testdir/test_regexp_utf8.vim +=================================================================== +--- git.orig/src/testdir/test_regexp_utf8.vim ++++ git/src/testdir/test_regexp_utf8.vim +@@ -215,3 +215,10 @@ func Test_optmatch_toolong() + set re=0 + endfunc + ++func Test_match_invalid_byte() ++ call writefile(0z630a.765d30aa0a.2e0a.790a.4030, 'Xinvalid') ++ new ++ source Xinvalid ++ bwipe! ++ call delete('Xinvalid') ++endfunc diff --git a/poky/meta/recipes-support/vim/files/b7081e135a16091c93f6f5f7525a5c58fb7ca9f9.patch b/poky/meta/recipes-support/vim/files/b7081e135a16091c93f6f5f7525a5c58fb7ca9f9.patch new file mode 100644 index 000000000..1cee75950 --- /dev/null +++ b/poky/meta/recipes-support/vim/files/b7081e135a16091c93f6f5f7525a5c58fb7ca9f9.patch @@ -0,0 +1,207 @@ +From b7081e135a16091c93f6f5f7525a5c58fb7ca9f9 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar <Bram@vim.org> +Date: Sat, 4 Sep 2021 18:47:28 +0200 +Subject: [PATCH] patch 8.2.3402: invalid memory access when using :retab with + large value + +Problem: Invalid memory access when using :retab with large value. +Solution: Check the number is positive. + +CVE: CVE-2021-3770 +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> +Upstream-Status: Backport [https://github.com/vim/vim/commit/b7081e135a16091c93f6f5f7525a5c58fb7ca9f9] +--- + src/indent.c | 34 +++++++++++++++++++++------------- + src/option.c | 12 ++++++------ + src/optionstr.c | 4 ++-- + src/testdir/test_retab.vim | 3 +++ + src/version.c | 2 ++ + 5 files changed, 34 insertions(+), 21 deletions(-) + +Index: git/src/indent.c +=================================================================== +--- git.orig/src/indent.c ++++ git/src/indent.c +@@ -18,18 +18,19 @@ + /* + * Set the integer values corresponding to the string setting of 'vartabstop'. + * "array" will be set, caller must free it if needed. ++ * Return FAIL for an error. + */ + int + tabstop_set(char_u *var, int **array) + { +- int valcount = 1; +- int t; +- char_u *cp; ++ int valcount = 1; ++ int t; ++ char_u *cp; + + if (var[0] == NUL || (var[0] == '0' && var[1] == NUL)) + { + *array = NULL; +- return TRUE; ++ return OK; + } + + for (cp = var; *cp != NUL; ++cp) +@@ -43,8 +44,8 @@ tabstop_set(char_u *var, int **array) + if (cp != end) + emsg(_(e_positive)); + else +- emsg(_(e_invarg)); +- return FALSE; ++ semsg(_(e_invarg2), cp); ++ return FAIL; + } + } + +@@ -55,26 +56,33 @@ tabstop_set(char_u *var, int **array) + ++valcount; + continue; + } +- emsg(_(e_invarg)); +- return FALSE; ++ semsg(_(e_invarg2), var); ++ return FAIL; + } + + *array = ALLOC_MULT(int, valcount + 1); + if (*array == NULL) +- return FALSE; ++ return FAIL; + (*array)[0] = valcount; + + t = 1; + for (cp = var; *cp != NUL;) + { +- (*array)[t++] = atoi((char *)cp); +- while (*cp != NUL && *cp != ',') ++ int n = atoi((char *)cp); ++ ++ if (n < 0 || n > 9999) ++ { ++ semsg(_(e_invarg2), cp); ++ return FAIL; ++ } ++ (*array)[t++] = n; ++ while (*cp != NUL && *cp != ',') + ++cp; + if (*cp != NUL) + ++cp; + } + +- return TRUE; ++ return OK; + } + + /* +@@ -1556,7 +1564,7 @@ ex_retab(exarg_T *eap) + + #ifdef FEAT_VARTABS + new_ts_str = eap->arg; +- if (!tabstop_set(eap->arg, &new_vts_array)) ++ if (tabstop_set(eap->arg, &new_vts_array) == FAIL) + return; + while (vim_isdigit(*(eap->arg)) || *(eap->arg) == ',') + ++(eap->arg); +Index: git/src/option.c +=================================================================== +--- git.orig/src/option.c ++++ git/src/option.c +@@ -2292,9 +2292,9 @@ didset_options2(void) + #endif + #ifdef FEAT_VARTABS + vim_free(curbuf->b_p_vsts_array); +- tabstop_set(curbuf->b_p_vsts, &curbuf->b_p_vsts_array); ++ (void)tabstop_set(curbuf->b_p_vsts, &curbuf->b_p_vsts_array); + vim_free(curbuf->b_p_vts_array); +- tabstop_set(curbuf->b_p_vts, &curbuf->b_p_vts_array); ++ (void)tabstop_set(curbuf->b_p_vts, &curbuf->b_p_vts_array); + #endif + } + +@@ -5756,7 +5756,7 @@ buf_copy_options(buf_T *buf, int flags) + buf->b_p_vsts = vim_strsave(p_vsts); + COPY_OPT_SCTX(buf, BV_VSTS); + if (p_vsts && p_vsts != empty_option) +- tabstop_set(p_vsts, &buf->b_p_vsts_array); ++ (void)tabstop_set(p_vsts, &buf->b_p_vsts_array); + else + buf->b_p_vsts_array = 0; + buf->b_p_vsts_nopaste = p_vsts_nopaste +@@ -5914,7 +5914,7 @@ buf_copy_options(buf_T *buf, int flags) + buf->b_p_isk = save_p_isk; + #ifdef FEAT_VARTABS + if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) +- tabstop_set(p_vts, &buf->b_p_vts_array); ++ (void)tabstop_set(p_vts, &buf->b_p_vts_array); + else + buf->b_p_vts_array = NULL; + #endif +@@ -5929,7 +5929,7 @@ buf_copy_options(buf_T *buf, int flags) + buf->b_p_vts = vim_strsave(p_vts); + COPY_OPT_SCTX(buf, BV_VTS); + if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) +- tabstop_set(p_vts, &buf->b_p_vts_array); ++ (void)tabstop_set(p_vts, &buf->b_p_vts_array); + else + buf->b_p_vts_array = NULL; + #endif +@@ -6634,7 +6634,7 @@ paste_option_changed(void) + if (buf->b_p_vsts_array) + vim_free(buf->b_p_vsts_array); + if (buf->b_p_vsts && buf->b_p_vsts != empty_option) +- tabstop_set(buf->b_p_vsts, &buf->b_p_vsts_array); ++ (void)tabstop_set(buf->b_p_vsts, &buf->b_p_vsts_array); + else + buf->b_p_vsts_array = 0; + #endif +Index: git/src/optionstr.c +=================================================================== +--- git.orig/src/optionstr.c ++++ git/src/optionstr.c +@@ -2166,7 +2166,7 @@ did_set_string_option( + if (errmsg == NULL) + { + int *oldarray = curbuf->b_p_vsts_array; +- if (tabstop_set(*varp, &(curbuf->b_p_vsts_array))) ++ if (tabstop_set(*varp, &(curbuf->b_p_vsts_array)) == OK) + { + if (oldarray) + vim_free(oldarray); +@@ -2205,7 +2205,7 @@ did_set_string_option( + { + int *oldarray = curbuf->b_p_vts_array; + +- if (tabstop_set(*varp, &(curbuf->b_p_vts_array))) ++ if (tabstop_set(*varp, &(curbuf->b_p_vts_array)) == OK) + { + vim_free(oldarray); + #ifdef FEAT_FOLDING +Index: git/src/testdir/test_retab.vim +=================================================================== +--- git.orig/src/testdir/test_retab.vim ++++ git/src/testdir/test_retab.vim +@@ -74,4 +74,7 @@ endfunc + func Test_retab_error() + call assert_fails('retab -1', 'E487:') + call assert_fails('retab! -1', 'E487:') ++ call assert_fails('ret -1000', 'E487:') ++ call assert_fails('ret 10000', 'E475:') ++ call assert_fails('ret 80000000000000000000', 'E475:') + endfunc +Index: git/src/version.c +=================================================================== +--- git.orig/src/version.c ++++ git/src/version.c +@@ -743,6 +743,8 @@ static char *(features[]) = + static int included_patches[] = + { /* Add new patch number below this line */ + /**/ ++ 3402, ++/**/ + 0 + }; + diff --git a/poky/meta/recipes-support/vim/vim.inc b/poky/meta/recipes-support/vim/vim.inc index 860fd2486..db1e9caf4 100644 --- a/poky/meta/recipes-support/vim/vim.inc +++ b/poky/meta/recipes-support/vim/vim.inc @@ -17,7 +17,10 @@ SRC_URI = "git://github.com/vim/vim.git \ file://0001-src-Makefile-improve-reproducibility.patch \ file://no-path-adjust.patch \ file://racefix.patch \ + file://b7081e135a16091c93f6f5f7525a5c58fb7ca9f9.patch \ + file://CVE-2021-3778.patch \ " + SRCREV = "98056533b96b6b5d8849641de93185dd7bcadc44" # Do not consider .z in x.y.z, as that is updated with every commit @@ -69,6 +72,7 @@ PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,," PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux," PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils," PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,," +PACKAGECONFIG[sound] = "--enable-canberra,--disable-canberra,canberra," EXTRA_OECONF = " \ --disable-gpm \ |