Patch review
cover Patch review
Please review this next set and have comments back by Friday
The following changes since commit c78140941f8a98e013932023a63501ba3b7e975a:
linux-yocto/5.2: update to v5.2.32 (2020-02-28 11:54:08 +0800)
are available in the Git repository at:
git://git.openembedded.org/openembedded-core-contrib stable/zeus-nut2
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=stable/zeus-nut2
Armin Kuster (2):
cve-check: fail gracefully when file not found wic/engine: lets display an error not a traceback
Bruce Ashfield (1):
linux-yocto/5.2: backport perf build fix for latest binutils
Chee Yang Lee (2):
cve-check: show whitelisted status
cve-check: fix ValueError
Khem Raj (1):
valgrind: Fix build with -fno-common
Lee Chee Yang (1):
virglrenderer: fix multiple CVEs
Mark Hatle (1):
gcc-cross-canadian: A missing space in an append caused an invalid
option
Michael Halstead (1):
yocto-uninative.inc: version 2.8 updates glibc to 2.31
Nathan Rossi (2):
gcc-cross.inc: Prevent native sysroot from leaking into configargs.h gcc-target.inc: Prevent sysroot from leaking into configargs.h
Ovidiu Panait (1):
dhcp: Fix REQUIRE(ctx->running) assertion triggered on SIGTERM/SIGINT
Rahul Chauhan (1):
ruby: fix CVE-2019-16254
Richard Purdie (2):
dummy-sdk-package: Add DUMMYPROVIDES_PACKAGES
maintainers: Add entry for buildtools-extended-tarball
Zhixiong Chi (1):
glibc: CVE-2020-10029
meta/classes/cve-check.bbclass | 25 ++- meta/conf/distro/include/maintainers.inc | 1 + meta/conf/distro/include/yocto-uninative.inc | 10 +- ...s-running-prior-to-calling-isc_app_c.patch | 165 ++++++++++++++++++ ...ed-shutdown-log-statment-to-dhcrelay.patch | 29 +++ .../dhcp/0003-Addressed-review-comment.patch | 31 ++++ meta/recipes-connectivity/dhcp/dhcp_4.4.1.bb | 3 + .../glibc/glibc/CVE-2020-10029.patch | 128 ++++++++++++++ meta/recipes-core/glibc/glibc_2.30.bb | 1 + meta/recipes-core/meta/dummy-sdk-package.inc | 3 + .../meta/nativesdk-buildtools-perl-dummy.bb | 5 +- .../meta/nativesdk-sdk-provides-dummy.bb | 5 +- .../meta/target-sdk-provides-dummy.bb | 1 - .../gcc/gcc-cross-canadian.inc | 4 +- meta/recipes-devtools/gcc/gcc-cross.inc | 7 + meta/recipes-devtools/gcc/gcc-runtime.inc | 4 - meta/recipes-devtools/gcc/gcc-target.inc | 8 + .../ruby/ruby/fix-CVE-2019-16254.patch | 106 +++++++++++ meta/recipes-devtools/ruby/ruby_2.5.5.bb | 1 + .../valgrind/valgrind/s390x_vec_op_t.patch | 19 ++ .../valgrind/valgrind_3.15.0.bb | 1 + .../virglrenderer/CVE-2019-18390.patch | 66 +++++++ .../virglrenderer/CVE-2019-18391.patch | 51 ++++++ .../virglrenderer/CVE-2020-8002.patch | 39 +++++ .../virglrenderer/virglrenderer_0.8.0.bb | 3 + .../linux/linux-yocto-rt_5.2.bb | 2 +- .../linux/linux-yocto-tiny_5.2.bb | 4 +- meta/recipes-kernel/linux/linux-yocto_5.2.bb | 18 +- scripts/lib/wic/engine.py | 5 +- 29 files changed, 710 insertions(+), 35 deletions(-) create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0001-Ensure-context-is-running-prior-to-calling-isc_app_c.patch create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0002-Added-shutdown-log-statment-to-dhcrelay.patch create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0003-Addressed-review-comment.patch create mode 100644 meta/recipes-core/glibc/glibc/CVE-2020-10029.patch create mode 100644 meta/recipes-devtools/ruby/ruby/fix-CVE-2019-16254.patch create mode 100644 meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18390.patch create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18391.patch create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2020-8002.patch
Signature · 1 line
2.17.1
PATCH 1/16 yocto-uninative.inc: version 2.8 updates glibc to 2.31
From: Michael Halstead <[email protected]>
Allow sstate use in Tumbleweed and other distros as they update glibc.
--- meta/conf/distro/include/yocto-uninative.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
meta/conf/distro/include/yocto-uninative.inc +5 -5
@@ -6,9 +6,9 @@ # to the distro running on the build machine. # -UNINATIVE_MAXGLIBCVERSION = "2.30" +UNINATIVE_MAXGLIBCVERSION = "2.31" -UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/2.7/" -UNINATIVE_CHECKSUM[aarch64] ?= "e76a45886ee8a0b3904b761c17ac8ff91edf9811ee455f1832d10763ba794dfc" -UNINATIVE_CHECKSUM[i686] ?= "810d027dfb1c7675226afbcec07808770516c969ee7378f6d8240281083f8924" -UNINATIVE_CHECKSUM[x86_64] ?= "9498d8bba047499999a7310ac2576d0796461184965351a56f6d32c888a1f216" +UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/2.8/" +UNINATIVE_CHECKSUM[aarch64] ?= "989187344bf9539b464fb7ed9c223e51f4bdb4c7a677d2c314e6fed393176efe" +UNINATIVE_CHECKSUM[i686] ?= "cc3e45bc8594488b407363e3fa9af5a099279dab2703c64342098719bd674990" +UNINATIVE_CHECKSUM[x86_64] ?= "a09922172c3a439105e0ae6b943daad2d83505b17da0aba97961ff433b8c21ab"
Signature · 1 line
2.17.1
PATCH 2/16 linux-yocto/5.2: backport perf build fix for latest binutils
In reply to Armin KusterFrom: Bruce Ashfield <[email protected]>
[
Author: Changbin Du <[email protected]>
Date: Tue Jan 28 23:29:38 2020 +0800
perf: Make perf able to build with latest libbfd
libbfd has changed the bfd_section_* macros to inline functions bfd_section_<field> since 2019-09-18. See below two commits:
o http://www.sourceware.org/ml/gdb-cvs/2019-09/msg00064.html
o https://www.sourceware.org/ml/gdb-cvs/2019-09/msg00072.html
This fix make perf able to build with both old and new libbfd.
]
--- .../recipes-kernel/linux/linux-yocto-rt_5.2.bb | 2 +- .../linux/linux-yocto-tiny_5.2.bb | 4 ++-- meta/recipes-kernel/linux/linux-yocto_5.2.bb | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-)
meta/recipes-kernel/linux/linux-yocto-rt_5.2.bb +1 -1
@@ -11,7 +11,7 @@ python () { raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it") } -SRCREV_machine ?= "b18bde6f0d8d1a5710cec9792372c03543cf0be9" +SRCREV_machine ?= "78e147f949b5b18524aa7bd72f1cc8f7ae8039f8" SRCREV_meta ?= "bb2776d6beaae64b1a0fc902b64376f082085498" SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
meta/recipes-kernel/linux/linux-yocto-tiny_5.2.bb +2 -2
@@ -15,8 +15,8 @@ DEPENDS += "openssl-native util-linux-native" KMETA = "kernel-meta" KCONF_BSP_AUDIT_LEVEL = "2" -SRCREV_machine_qemuarm ?= "ed1c3b7ad8221ba4e20ce7e4e4f6a73afd5015d4" -SRCREV_machine ?= "c926964d00caf714f42878535af8c7374452072d" +SRCREV_machine_qemuarm ?= "e0a3a01b24070b15121e938ea19755091bf0d662" +SRCREV_machine ?= "73b12de4c879e4569bef3b2d0ee9c783a9788b27" SRCREV_meta ?= "bb2776d6beaae64b1a0fc902b64376f082085498" PV = "${LINUX_VERSION}+git${SRCPV}"
meta/recipes-kernel/linux/linux-yocto_5.2.bb +9 -9
@@ -12,15 +12,15 @@ KBRANCH_qemux86 ?= "v5.2/standard/base" KBRANCH_qemux86-64 ?= "v5.2/standard/base" KBRANCH_qemumips64 ?= "v5.2/standard/mti-malta64" -SRCREV_machine_qemuarm ?= "1ed2236e622e5b79d910fc1db37ec6eec5a94fdc" -SRCREV_machine_qemuarm64 ?= "c926964d00caf714f42878535af8c7374452072d" -SRCREV_machine_qemumips ?= "e669e4307d07072458904ac0fda56f7192e2880d" -SRCREV_machine_qemuppc ?= "c926964d00caf714f42878535af8c7374452072d" -SRCREV_machine_qemuriscv64 ?= "c926964d00caf714f42878535af8c7374452072d" -SRCREV_machine_qemux86 ?= "c926964d00caf714f42878535af8c7374452072d" -SRCREV_machine_qemux86-64 ?= "c926964d00caf714f42878535af8c7374452072d" -SRCREV_machine_qemumips64 ?= "217cada95bbe7eb4c3a6d40ee141ea4cea3bc1b6" -SRCREV_machine ?= "c926964d00caf714f42878535af8c7374452072d" +SRCREV_machine_qemuarm ?= "fdb7cd1bb5e4238e5b3d120ce9db31119ec2b5ee" +SRCREV_machine_qemuarm64 ?= "73b12de4c879e4569bef3b2d0ee9c783a9788b27" +SRCREV_machine_qemumips ?= "eb7faee13cfce200e9add4ba1852a3fe5d8b92e6" +SRCREV_machine_qemuppc ?= "73b12de4c879e4569bef3b2d0ee9c783a9788b27" +SRCREV_machine_qemuriscv64 ?= "73b12de4c879e4569bef3b2d0ee9c783a9788b27" +SRCREV_machine_qemux86 ?= "73b12de4c879e4569bef3b2d0ee9c783a9788b27" +SRCREV_machine_qemux86-64 ?= "73b12de4c879e4569bef3b2d0ee9c783a9788b27" +SRCREV_machine_qemumips64 ?= "8e3bfeb7e9b5aa92c5bea941d361ff5b081a2aaa" +SRCREV_machine ?= "73b12de4c879e4569bef3b2d0ee9c783a9788b27" SRCREV_meta ?= "bb2776d6beaae64b1a0fc902b64376f082085498" # remap qemuarm to qemuarma15 for the 5.2 kernel
Signature · 1 line
2.17.1
PATCH 3/16 cve-check: fail gracefully when file not found
In reply to Armin KusterWith out these changes, a traceback displayed when a file is listed in the SRC_URI but the file does not exist.
raise FileNotFoundError and print the patch then mark the task as failed.
--- meta/classes/cve-check.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
meta/classes/cve-check.bbclass +8 -1
@@ -52,7 +52,10 @@ python do_cve_check () { """ if os.path.exists(d.getVar("CVE_CHECK_DB_FILE")): - patched_cves = get_patches_cves(d) + try: + patched_cves = get_patches_cves(d) + except FileNotFoundError: + bb.fatal("Failure in searching patches") patched, unpatched = check_cves(d, patched_cves) if patched or unpatched: cve_data = get_cve_info(d, patched + unpatched)
@@ -129,6 +132,10 @@ def get_patches_cves(d): for url in src_patches(d): patch_file = bb.fetch.decodeurl(url)[2] + if not os.path.isfile(patch_file): + bb.error("File Not found: %s" % patch_file) + raise FileNotFoundError + # Check patch file name for CVE ID fname_match = cve_file_name_match.search(patch_file) if fname_match:
Signature · 1 line
2.17.1
PATCH 4/16 dummy-sdk-package: Add DUMMYPROVIDES_PACKAGES
In reply to Armin KusterFrom: Richard Purdie <[email protected]>
We're about to need to use this variable in the main include file so restructure the users of it to all set it appropriately.
--- meta/recipes-core/meta/dummy-sdk-package.inc | 3 +++ meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb | 5 ++++- meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb | 5 ++++- meta/recipes-core/meta/target-sdk-provides-dummy.bb | 1 - 4 files changed, 11 insertions(+), 3 deletions(-)
meta/recipes-core/meta/dummy-sdk-package.inc +3 -0
@@ -17,6 +17,9 @@ ALLOW_EMPTY_${PN} = "1" PR[vardeps] += "DUMMYPROVIDES" +DUMMYPROVIDES_PACKAGES ??= "" +DUMMYPROVIDES += "${@' '.join([multilib_pkg_extend(d, pkg) for pkg in d.getVar('DUMMYPROVIDES_PACKAGES').split()])}" + python populate_packages_prepend() { p = d.getVar("PN") d.appendVar("RPROVIDES_%s" % p, "${DUMMYPROVIDES}")
meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb +4 -1
@@ -1,6 +1,6 @@ DUMMYARCH = "buildtools-dummy-${SDKPKGSUFFIX}" -DUMMYPROVIDES = "\ +DUMMYPROVIDES_PACKAGES = "\ nativesdk-perl \ nativesdk-libxml-parser-perl \ nativesdk-perl-module-bytes \
@@ -21,6 +21,9 @@ DUMMYPROVIDES = "\ nativesdk-perl-module-posix \ nativesdk-perl-module-thread-queue \ nativesdk-perl-module-threads \ +" + +DUMMYPROVIDES = "\ /usr/bin/perl \ "
meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb +4 -1
@@ -1,10 +1,13 @@ DUMMYARCH = "sdk-provides-dummy-${SDKPKGSUFFIX}" +DUMMYPROVIDES_PACKAGES = "\ + pkgconfig \ +" + # Add /bin/sh? DUMMYPROVIDES = "\ /bin/bash \ /usr/bin/env \ - pkgconfig \ libGL.so()(64bit) \ libGL.so \ "
meta/recipes-core/meta/target-sdk-provides-dummy.bb +0 -1
@@ -48,7 +48,6 @@ DUMMYPROVIDES_PACKAGES = "\ " DUMMYPROVIDES = "\ - ${@' '.join([multilib_pkg_extend(d, pkg) for pkg in d.getVar('DUMMYPROVIDES_PACKAGES').split()])} \ /bin/sh \ /bin/bash \ /usr/bin/env \
Signature · 1 line
2.17.1
PATCH 5/16 wic/engine: lets display an error not a traceback
In reply to Armin KusterIf the requested partition does not exist in this request "wic ls {path}:pnum" display a nice message not a trackback
Also fix displaying the pnum and not "%s"
--- scripts/lib/wic/engine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/lib/wic/engine.py +4 -1
@@ -290,7 +290,7 @@ class Disk: def _get_part_image(self, pnum): if pnum not in self.partitions: - raise WicError("Partition %s is not in the image") + raise WicError("Partition %s is not in the image" % pnum) part = self.partitions[pnum] # check if fstype is supported for fstype in self.fstypes:
@@ -313,6 +313,9 @@ class Disk: seek=self.partitions[pnum].start) def dir(self, pnum, path): + if pnum not in self.partitions: + raise WicError("Partition %s is not in the image" % pnum) + if self.partitions[pnum].fstype.startswith('ext'): return exec_cmd("{} {} -R 'ls -l {}'".format(self.debugfs, self._get_part_image(pnum),
Signature · 1 line
2.17.1
PATCH 6/16 valgrind: Fix build with -fno-common
In reply to Armin KusterFrom: Khem Raj <[email protected]>
--- .../valgrind/valgrind/s390x_vec_op_t.patch | 19 +++++++++++++++++++ .../valgrind/valgrind_3.15.0.bb | 1 + 2 files changed, 20 insertions(+) create mode 100644 meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch
meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch new file +19 -0
@@ -0,0 +1,19 @@ +s390x_vec_op_t is not needed anywhere, only elements of enum are accessed +removing it ensures that valgrind can be built with -fno-common option + +Fixes +ld: ../../VEX/libvex-amd64-linux.a(libvex_amd64_linux_a-guest_s390_helpers.o):/usr/src/debug/valgrind/3.15.0-r0/build/VEX/../../valgrind-3.15.0/VEX/priv/guest_s390_defs.h:289: multiple definition of `s390x_vec_op_t'; ../../VEX/libvexmultiarch-amd64-linux.a(libvexmultiarch_amd64_linux_a-multiarch_main_main.o):/usr/src/debug/valgrind/3.15.0-r0/build/VEX/../../valgrind-3.15.0/VEX/priv/guest_s390_defs.h:289: first defined here + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> +--- a/VEX/priv/guest_s390_defs.h ++++ b/VEX/priv/guest_s390_defs.h +@@ -286,7 +286,7 @@ enum { + S390_VEC_OP_VFCHE = 18, + S390_VEC_OP_VFTCI = 19, + S390_VEC_OP_LAST = 20 // supposed to be the last element in enum +-} s390x_vec_op_t; ++}; + + /* Arguments of s390x_dirtyhelper_vec_op(...) which are packed into one + ULong variable.
meta/recipes-devtools/valgrind/valgrind_3.15.0.bb +1 -0
@@ -40,6 +40,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \ file://0001-valgrind-filter_xml_frames-do-not-filter-usr.patch \ file://0002-valgrind-adjust-std_list-expected-output.patch \ file://0001-adjust-path-filter-for-2-memcheck-tests.patch \ + file://s390x_vec_op_t.patch \ " SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975" SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1"
Signature · 1 line
2.17.1
Re: [zeus 06/16] valgrind: Fix build with -fno-common
This patch is required for switching to gcc 10 (which changes the default to -fno-common) in Yocto 3.2.
AFAIK there is no benefit in backporting it to older releases.
cu
Adrian
Re: [zeus 06/16] valgrind: Fix build with -fno-common
Quoted 5 lines · Adrian Bunk
This patch is required for switching to gcc 10 (which changes the default to -fno-common) in Yocto 3.2.
AFAIK there is no benefit in backporting it to older releases.
I tend to agree.
Quoted 3 lines
cu
Adrian
PATCH 7/16 gcc-cross-canadian: A missing space in an append caused an invalid option
In reply to Armin KusterFrom: Mark Hatle <[email protected]>
When configuring the cross-candian toolchain for a non-linux target system, the resulting gcc configuration included:
--enable-initfini-array--without-headers
these should have been two separate options.
--- meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +2 -2
@@ -158,7 +158,7 @@ SYSTEMLIBS1 = "${target_libdir}/" EXTRA_OECONF += "--enable-poison-system-directories" EXTRA_OECONF_remove_elf = "--with-sysroot=/not/exist" EXTRA_OECONF_remove_eabi = "--with-sysroot=/not/exist" -EXTRA_OECONF_append_elf = "--without-headers --with-newlib" -EXTRA_OECONF_append_eabi = "--without-headers --with-newlib" +EXTRA_OECONF_append_elf = " --without-headers --with-newlib" +EXTRA_OECONF_append_eabi = " --without-headers --with-newlib" # gcc 4.7 needs -isystem export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
Signature · 1 line
2.17.1
PATCH 8/16 gcc-cross.inc: Prevent native sysroot from leaking into configargs.h
In reply to Armin KusterFrom: Nathan Rossi <[email protected]>
Prevent the native(sdk) sysroot path from leaking into configargs.h. The configargs.h header is intended to be static and unchanged as the content is used as a means of determining that a gcc plugin is built for the same gcc. This also effects the output of 'gcc --version'. Due to per recipe sysroots and staging, the sysroot path would be replaced with the sysroot local to the recipe thus changing the content of configargs.h.
The sysroot path is replaced with a generic "/host" prefix which represents the host sysroot (e.g. native or nativesdk).
--- meta/recipes-devtools/gcc/gcc-cross.inc | 7 +++++++ meta/recipes-devtools/gcc/gcc-runtime.inc | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-)
meta/recipes-devtools/gcc/gcc-cross.inc +7 -0
@@ -61,6 +61,13 @@ do_compile () { export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" + # Prevent native/host sysroot path from being used in configargs.h header, + # as it will be rewritten when used by other sysroots preventing support + # for gcc plugins + oe_runmake configure-gcc + sed -i 's@${STAGING_DIR_TARGET}@/host@g' ${B}/gcc/configargs.h + sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/configargs.h + oe_runmake all-host configure-target-libgcc (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) # now generate script to drive testing
meta/recipes-devtools/gcc/gcc-runtime.inc +0 -4
@@ -302,10 +302,6 @@ do_check() { # HACK: this works around the configure setting CXX with -nostd* args sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1) - # HACK: this works around the de-stashing changes to configargs.h, as well as recipe-sysroot changing the content - sed -i '/static const char configuration_arguments/d' ${B}/gcc/configargs.h - ${CC} -v 2>&1 | grep "^Configured with:" | \ - sed 's/Configured with: \(.*\)/static const char configuration_arguments[] = "\1";/g' >> ${B}/gcc/configargs.h if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then # qemu user has issues allocating large amounts of memory
Signature · 1 line
2.17.1
PATCH 9/16 gcc-target.inc: Prevent sysroot from leaking into configargs.h
In reply to Armin KusterFrom: Nathan Rossi <[email protected]>
Prevent the full recipe-sysroot path from leaking into configargs.h. The configargs.h header is intended to be static and unchanged as the content is used as a means of determining that a gcc plugin is built for the same gcc. This also effects the output of 'gcc -v'. Due to per recipe sysroots and staging, the sysroot path would be replaced with the sysroot local to the recipe thus changing the content of configargs.h. This change also improves gcc binary reproducibility. The sysroot path is replaced with the base target root "/".
--- meta/recipes-devtools/gcc/gcc-target.inc | 8 ++++++++ 1 file changed, 8 insertions(+)
meta/recipes-devtools/gcc/gcc-target.inc +8 -0
@@ -137,6 +137,14 @@ FILES_${PN}-doc = "\ " do_compile () { + # Prevent full target sysroot path from being used in configargs.h header, + # as it will be rewritten when used by other sysroots preventing support + # for gcc plugins. Additionally the path is embeddeded into the output + # binary, this prevents building a reproducible binary. + oe_runmake configure-gcc + sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/configargs.h + sed -i 's@${STAGING_DIR_HOST}@/@g' ${B}/gcc/configargs.h + oe_runmake all-host }
Signature · 1 line
2.17.1
PATCH 10/16 ruby: fix CVE-2019-16254
In reply to Armin KusterFrom: Rahul Chauhan <[email protected]>
--- .../ruby/ruby/fix-CVE-2019-16254.patch | 106 ++++++++++++++++++ meta/recipes-devtools/ruby/ruby_2.5.5.bb | 1 + 2 files changed, 107 insertions(+) create mode 100644 meta/recipes-devtools/ruby/ruby/fix-CVE-2019-16254.patch
meta/recipes-devtools/ruby/ruby/fix-CVE-2019-16254.patch new file +106 -0
@@ -0,0 +1,106 @@ +From 18d5289b4579822e391b3f5c16541e6552e9f06c Mon Sep 17 00:00:00 2001 +From: Yusuke Endoh <[email protected]> +Date: Tue, 1 Oct 2019 12:29:18 +0900 +Subject: [PATCH] WEBrick: prevent response splitting and header injection + +This is a follow up to d9d4a28f1cdd05a0e8dabb36d747d40bbcc30f16. +The commit prevented CRLR, but did not address an isolated CR or an +isolated LF. + +Upstream-Status: Backport https://github.com/ruby/ruby/commit/3ce238b5f9795581eb84114dcfbdf4aa086bfecc +CVE: CVE-2019-16254 + +Co-Authored-By: NARUSE, Yui <[email protected]> +Signed-off-by: Rahul Chauhan <[email protected]> +--- + lib/webrick/httpresponse.rb | 3 ++- + test/webrick/test_httpresponse.rb | 46 +++++++++++++++++++++++++++++++++++++-- + 2 files changed, 46 insertions(+), 3 deletions(-) + +diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb +index 6d77692..d26324c 100644 +--- a/lib/webrick/httpresponse.rb ++++ b/lib/webrick/httpresponse.rb +@@ -367,7 +367,8 @@ def set_error(ex, backtrace=false) + private + + def check_header(header_value) +- if header_value =~ /\r\n/ ++ header_value = header_value.to_s ++ if /[\r\n]/ =~ header_value + raise InvalidHeader + else + header_value +diff --git a/test/webrick/test_httpresponse.rb b/test/webrick/test_httpresponse.rb +index 6263e0a..24a6968 100644 +--- a/test/webrick/test_httpresponse.rb ++++ b/test/webrick/test_httpresponse.rb +@@ -29,7 +29,7 @@ def setup + @res.keep_alive = true + end + +- def test_prevent_response_splitting_headers ++ def test_prevent_response_splitting_headers_crlf + res['X-header'] = "malicious\r\nCookie: hack" + io = StringIO.new + res.send_response io +@@ -39,7 +39,7 @@ def test_prevent_response_splitting_headers + refute_match 'hack', io.string + end + +- def test_prevent_response_splitting_cookie_headers ++ def test_prevent_response_splitting_cookie_headers_crlf + user_input = "malicious\r\nCookie: hack" + res.cookies << WEBrick::Cookie.new('author', user_input) + io = StringIO.new +@@ -50,6 +50,48 @@ def test_prevent_response_splitting_cookie_headers + refute_match 'hack', io.string + end + ++ def test_prevent_response_splitting_headers_cr ++ res['X-header'] = "malicious\rCookie: hack" ++ io = StringIO.new ++ res.send_response io ++ io.rewind ++ res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io)) ++ assert_equal '500', res.code ++ refute_match 'hack', io.string ++ end ++ ++ def test_prevent_response_splitting_cookie_headers_cr ++ user_input = "malicious\rCookie: hack" ++ res.cookies << WEBrick::Cookie.new('author', user_input) ++ io = StringIO.new ++ res.send_response io ++ io.rewind ++ res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io)) ++ assert_equal '500', res.code ++ refute_match 'hack', io.string ++ end ++ ++ def test_prevent_response_splitting_headers_lf ++ res['X-header'] = "malicious\nCookie: hack" ++ io = StringIO.new ++ res.send_response io ++ io.rewind ++ res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io)) ++ assert_equal '500', res.code ++ refute_match 'hack', io.string ++ end ++ ++ def test_prevent_response_splitting_cookie_headers_lf ++ user_input = "malicious\nCookie: hack" ++ res.cookies << WEBrick::Cookie.new('author', user_input) ++ io = StringIO.new ++ res.send_response io ++ io.rewind ++ res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io)) ++ assert_equal '500', res.code ++ refute_match 'hack', io.string ++ end ++ + def test_304_does_not_log_warning + res.status = 304 + res.setup_header +-- +2.7.4
meta/recipes-devtools/ruby/ruby_2.5.5.bb +1 -0
@@ -3,6 +3,7 @@ require ruby.inc SRC_URI += " \ file://0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch \ file://run-ptest \ + file://fix-CVE-2019-16254.patch \ " SRC_URI[md5sum] = "7e156fb526b8f4bb1b30a3dd8a7ce400"
Signature · 1 line
2.17.1
PATCH 11/16 dhcp: Fix REQUIRE(ctx->running) assertion triggered on SIGTERM/SIGINT
In reply to Armin KusterFrom: Ovidiu Panait <[email protected]>
Closed a small window of time between the installation of graceful shutdown signal handlers and application context startup, during which the receipt of shutdown signal would cause a REQUIRE() assertion to occur. Note this issue is only visible when compiling with ENABLE_GENTLE_SHUTDOWN defined.
Reference:
https://gitlab.isc.org/isc-projects/dhcp/issues/53
Upstream patches:
https://gitlab.isc.org/isc-projects/dhcp/commit/ce117de7a1ed3c4911b4009c1cc23fba85370a26
https://gitlab.isc.org/isc-projects/dhcp/commit/dbd36dfa82956b53683462afadfabb1b33fa3dd1
https://gitlab.isc.org/isc-projects/dhcp/commit/95944cab6035d20be270eec01254c7bb867ec705
--- ...s-running-prior-to-calling-isc_app_c.patch | 165 ++++++++++++++++++ ...ed-shutdown-log-statment-to-dhcrelay.patch | 29 +++ .../dhcp/0003-Addressed-review-comment.patch | 31 ++++ meta/recipes-connectivity/dhcp/dhcp_4.4.1.bb | 3 + 4 files changed, 228 insertions(+) create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0001-Ensure-context-is-running-prior-to-calling-isc_app_c.patch create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0002-Added-shutdown-log-statment-to-dhcrelay.patch create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0003-Addressed-review-comment.patch
meta/recipes-connectivity/dhcp/dhcp/0001-Ensure-context-is-running-prior-to-calling-isc_app_c.patch new file +165 -0
@@ -0,0 +1,165 @@ +From f369dbb9e67eb5ef336944af63039b6d8f838384 Mon Sep 17 00:00:00 2001 +From: Thomas Markwalder <[email protected]> +Date: Thu, 12 Sep 2019 10:35:46 -0400 +Subject: [PATCH 1/3] Ensure context is running prior to calling + isc_app_ctxsuspend + +Add a release note. + +includes/omapip/isclib.h + Added actx_running flag to global context, dhcp_gbl_ctx + +omapip/isclib.c + set_ctx_running() - new function used as the ctxonrun callback + + dhcp_context_create() - installs set_ctx_running callback + + dhcp_signal_handler() - modified to use act_running flag to + determine is context is running and should be suspended + +Upstream-Status: Backport [https://gitlab.isc.org/isc-projects/dhcp.git] + +Signed-off-by: Ovidiu Panait <[email protected]> +--- + RELNOTES | 7 +++++ + includes/omapip/isclib.h | 3 ++- + omapip/isclib.c | 57 +++++++++++++++++++++++++++++++++------- + 3 files changed, 57 insertions(+), 10 deletions(-) + +diff --git a/RELNOTES b/RELNOTES +index f10305d..1730473 100644 +--- a/RELNOTES ++++ b/RELNOTES +@@ -6,6 +6,13 @@ + + NEW FEATURES + ++- Closed a small window of time between the installation of graceful ++ shutdown signal handlers and application context startup, during which ++ the receipt of shutdown signal would cause a REQUIRE() assertion to ++ occur. Note this issue is only visible when compiling with ++ ENABLE_GENTLE_SHUTDOWN defined. ++ [Gitlab #53,!18 git TBD] ++ + Please note that that ISC DHCP is now licensed under the Mozilla Public License, + MPL 2.0. Please see https://www.mozilla.org/en-US/MPL/2.0/ to read the MPL 2.0 + license terms. +diff --git a/includes/omapip/isclib.h b/includes/omapip/isclib.h +index 6c20584..af6a6fc 100644 +--- a/includes/omapip/isclib.h ++++ b/includes/omapip/isclib.h +@@ -94,7 +94,8 @@ + typedef struct dhcp_context { + isc_mem_t *mctx; + isc_appctx_t *actx; +- int actx_started; ++ int actx_started; // ISC_TRUE if ctxstart has been called ++ int actx_running; // ISC_TRUE if ctxrun has been called + isc_taskmgr_t *taskmgr; + isc_task_t *task; + isc_socketmgr_t *socketmgr; +diff --git a/omapip/isclib.c b/omapip/isclib.c +index ce4b4a1..73e017c 100644 +--- a/omapip/isclib.c ++++ b/omapip/isclib.c +@@ -134,6 +134,35 @@ handle_signal(int sig, void (*handler)(int)) { + } + } + ++/* Callback passed to isc_app_ctxonrun ++ * ++ * BIND9 context code will invoke this handler once the context has ++ * entered the running state. We use it to set a global marker so that ++ * we can tell if the context is running. Several of the isc_app_ ++ * calls REQUIRE that the context is running and we need a way to ++ * know that. ++ * ++ * We also check to see if we received a shutdown signal prior to ++ * the context entering the run state. If we did, then we can just ++ * simply shut the context down now. This closes the relatively ++ * small window between start up and entering run via the call ++ * to dispatch(). ++ * ++ */ ++static void ++set_ctx_running(isc_task_t *task, isc_event_t *event) { ++ task = task; // unused; ++ dhcp_gbl_ctx.actx_running = ISC_TRUE; ++ ++ if (shutdown_signal) { ++ // We got signaled shutdown before we entered running state. ++ // Now that we've reached running state, shut'er down. ++ isc_app_ctxsuspend(dhcp_gbl_ctx.actx); ++ } ++ ++ isc_event_free(&event); ++} ++ + isc_result_t + dhcp_context_create(int flags, + struct in_addr *local4, +@@ -141,6 +170,9 @@ dhcp_context_create(int flags, + isc_result_t result; + + if ((flags & DHCP_CONTEXT_PRE_DB) != 0) { ++ dhcp_gbl_ctx.actx_started = ISC_FALSE; ++ dhcp_gbl_ctx.actx_running = ISC_FALSE; ++ + /* + * Set up the error messages, this isn't the right place + * for this call but it is convienent for now. +@@ -204,15 +236,24 @@ dhcp_context_create(int flags, + if (result != ISC_R_SUCCESS) + goto cleanup; + +- result = isc_task_create(dhcp_gbl_ctx.taskmgr, 0, &dhcp_gbl_ctx.task); ++ result = isc_task_create(dhcp_gbl_ctx.taskmgr, 0, ++ &dhcp_gbl_ctx.task); + if (result != ISC_R_SUCCESS) + goto cleanup; + + result = isc_app_ctxstart(dhcp_gbl_ctx.actx); + if (result != ISC_R_SUCCESS) +- return (result); ++ goto cleanup; ++ + dhcp_gbl_ctx.actx_started = ISC_TRUE; + ++ // Install the onrun callback. ++ result = isc_app_ctxonrun(dhcp_gbl_ctx.actx, dhcp_gbl_ctx.mctx, ++ dhcp_gbl_ctx.task, set_ctx_running, ++ dhcp_gbl_ctx.actx); ++ if (result != ISC_R_SUCCESS) ++ goto cleanup; ++ + /* Not all OSs support suppressing SIGPIPE through socket + * options, so set the sigal action to be ignore. This allows + * broken connections to fail gracefully with EPIPE on writes */ +@@ -335,19 +376,17 @@ isclib_make_dst_key(char *inname, + * @param signal signal code that we received + */ + void dhcp_signal_handler(int signal) { +- isc_appctx_t *ctx = dhcp_gbl_ctx.actx; +- int prev = shutdown_signal; +- +- if (prev != 0) { ++ if (shutdown_signal != 0) { + /* Already in shutdown. */ + return; + } ++ + /* Possible race but does it matter? */ + shutdown_signal = signal; + +- /* Use reload (aka suspend) for easier dispatch() reenter. */ +- if (ctx && ctx->methods && ctx->methods->ctxsuspend) { +- (void) isc_app_ctxsuspend(ctx); ++ /* If the application context is running tell it to shut down */ ++ if (dhcp_gbl_ctx.actx_running == ISC_TRUE) { ++ (void) isc_app_ctxsuspend(dhcp_gbl_ctx.actx); + } + } + +-- +2.23.0 +
meta/recipes-connectivity/dhcp/dhcp/0002-Added-shutdown-log-statment-to-dhcrelay.patch new file +29 -0
@@ -0,0 +1,29 @@ +From adcd34ae1f56b16d7e9696d980332b4cf6c7ce91 Mon Sep 17 00:00:00 2001 +From: Thomas Markwalder <[email protected]> +Date: Fri, 13 Sep 2019 15:03:31 -0400 +Subject: [PATCH 2/3] Added shutdown log statment to dhcrelay + +Upstream-Status: Backport [https://gitlab.isc.org/isc-projects/dhcp.git] + +Signed-off-by: Ovidiu Panait <[email protected]> +--- + relay/dhcrelay.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c +index d8caaaf..4bd1d47 100644 +--- a/relay/dhcrelay.c ++++ b/relay/dhcrelay.c +@@ -2076,6 +2076,9 @@ dhcp_set_control_state(control_object_state_t oldstate, + if (newstate != server_shutdown) + return ISC_R_SUCCESS; + ++ /* Log shutdown on signal. */ ++ log_info("Received signal %d, initiating shutdown.", shutdown_signal); ++ + if (no_pid_file == ISC_FALSE) + (void) unlink(path_dhcrelay_pid); + +-- +2.23.0 +
meta/recipes-connectivity/dhcp/dhcp/0003-Addressed-review-comment.patch new file +31 -0
@@ -0,0 +1,31 @@ +From e4b54b4d676783152d487103714cba2913661ef8 Mon Sep 17 00:00:00 2001 +From: Thomas Markwalder <[email protected]> +Date: Wed, 6 Nov 2019 15:53:50 -0500 +Subject: [PATCH 3/3] Addressed review comment. + +omapip/isclib.c + Added use of IGNORE_UNUSED() + +Upstream-Status: Backport [https://gitlab.isc.org/isc-projects/dhcp.git] + +Signed-off-by: Ovidiu Panait <[email protected]> +--- + omapip/isclib.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/omapip/isclib.c b/omapip/isclib.c +index 73e017c..1d52463 100644 +--- a/omapip/isclib.c ++++ b/omapip/isclib.c +@@ -151,7 +151,7 @@ handle_signal(int sig, void (*handler)(int)) { + */ + static void + set_ctx_running(isc_task_t *task, isc_event_t *event) { +- task = task; // unused; ++ IGNORE_UNUSED(task); + dhcp_gbl_ctx.actx_running = ISC_TRUE; + + if (shutdown_signal) { +-- +2.23.0 +
meta/recipes-connectivity/dhcp/dhcp_4.4.1.bb +3 -0
@@ -11,6 +11,9 @@ SRC_URI += "file://0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.pat file://0013-fixup_use_libbind.patch \ file://0001-master-Added-includes-of-new-BIND9-compatibility-hea.patch \ file://0001-Fix-a-NSUPDATE-compiling-issue.patch \ + file://0001-Ensure-context-is-running-prior-to-calling-isc_app_c.patch \ + file://0002-Added-shutdown-log-statment-to-dhcrelay.patch \ + file://0003-Addressed-review-comment.patch \ " SRC_URI[md5sum] = "18c7f4dcbb0a63df25098216d47b1ede"
Signature · 1 line
2.17.1
PATCH 12/16 virglrenderer: fix multiple CVEs
In reply to Armin KusterFrom: Lee Chee Yang <[email protected]>
fix these CVE:
CVE-2019-18390
CVE-2019-18391
CVE-2020-8002
--- .../virglrenderer/CVE-2019-18390.patch | 66 +++++++++++++++++++ .../virglrenderer/CVE-2019-18391.patch | 51 ++++++++++++++ .../virglrenderer/CVE-2020-8002.patch | 39 +++++++++++ .../virglrenderer/virglrenderer_0.8.0.bb | 3 + 4 files changed, 159 insertions(+) create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18390.patch create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18391.patch create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2020-8002.patch
meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18390.patch new file +66 -0
@@ -0,0 +1,66 @@ +From 24f67de7a9088a873844a39be03cee6882260ac9 Mon Sep 17 00:00:00 2001 +From: Gert Wollny <[email protected]> +Date: Mon, 7 Oct 2019 10:59:56 +0200 +Subject: [PATCH] vrend: check info formats in blits + +Closes #141 +Closes #142 + +v2 : drop colon in error description (Emil) + +Signed-off-by: Gert Wollny <[email protected]> +Reviewed-by: Emil Velikov <[email protected]> + +Upstream-Status: Backport +[https://gitlab.freedesktop.org/virgl/virglrenderer/commit/24f67de7a9088a873844a39be03cee6882260ac9] +CVE: CVE-2019-18390 +Signed-off-by: Lee Chee Yang <[email protected]> +--- + src/virgl_hw.h | 1 + + src/vrend_renderer.c | 11 +++++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/src/virgl_hw.h b/src/virgl_hw.h +index 145780bf..5ccf3073 100644 +--- a/src/virgl_hw.h ++++ b/src/virgl_hw.h +@@ -426,6 +426,7 @@ enum virgl_ctx_errors { + VIRGL_ERROR_CTX_ILLEGAL_CMD_BUFFER, + VIRGL_ERROR_CTX_GLES_HAVE_TES_BUT_MISS_TCS, + VIRGL_ERROR_GL_ANY_SAMPLES_PASSED, ++ VIRGL_ERROR_CTX_ILLEGAL_FORMAT, + }; + + #define VIRGL_RESOURCE_Y_0_TOP (1 << 0) +diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c +index 14fefb38..aa6a89c1 100644 +--- a/src/vrend_renderer.c ++++ b/src/vrend_renderer.c +@@ -758,6 +758,7 @@ static const char *vrend_ctx_error_strings[] = { + [VIRGL_ERROR_CTX_ILLEGAL_CMD_BUFFER] = "Illegal command buffer", + [VIRGL_ERROR_CTX_GLES_HAVE_TES_BUT_MISS_TCS] = "On GLES context and shader program has tesselation evaluation shader but no tesselation control shader", + [VIRGL_ERROR_GL_ANY_SAMPLES_PASSED] = "Query for ANY_SAMPLES_PASSED not supported", ++ [VIRGL_ERROR_CTX_ILLEGAL_FORMAT] = "Illegal format ID", + }; + + static void __report_context_error(const char *fname, struct vrend_context *ctx, +@@ -8492,6 +8493,16 @@ void vrend_renderer_blit(struct vrend_context *ctx, + if (ctx->in_error) + return; + ++ if (!info->src.format || (enum virgl_formats)info->src.format >= VIRGL_FORMAT_MAX) { ++ report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_FORMAT, info->src.format); ++ return; ++ } ++ ++ if (!info->dst.format || (enum virgl_formats)info->dst.format >= VIRGL_FORMAT_MAX) { ++ report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_FORMAT, info->dst.format); ++ return; ++ } ++ + if (info->render_condition_enable == false) + vrend_pause_render_condition(ctx, true); + +-- +2.24.1 +
meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2019-18391.patch new file +51 -0
51 lines not on this page · raw message
meta/recipes-graphics/virglrenderer/virglrenderer/CVE-2020-8002.patch new file +39 -0
@@ -0,0 +1,39 @@ +From 63bcca251f093d83da7e290ab4bbd38ae69089b5 Mon Sep 17 00:00:00 2001 +From: Gert Wollny <[email protected]> +Date: Wed, 15 Jan 2020 13:43:58 +0100 +Subject: [PATCH] vrend: Don't try launching a grid if no CS is available + +Closes #155 + +Signed-off-by: Gert Wollny <[email protected]> +Reviewed-by: Gurchetan Singh <[email protected]> + +Upstream-Status: Backport +[https://gitlab.freedesktop.org/virgl/virglrenderer/-/commit/63bcca251f093d83da7e290ab4bbd38ae69089b5.patch] +CVE: CVE-2020-8002 +Signed-off-by: Lee Chee Yang <[email protected]> +--- + src/vrend_renderer.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c +index a054bad8..2280fc43 100644 +--- a/src/vrend_renderer.c ++++ b/src/vrend_renderer.c +@@ -4604,6 +4604,13 @@ void vrend_launch_grid(struct vrend_context *ctx, + } + ctx->sub->shader_dirty = true; + } ++ ++ if (!ctx->sub->prog) { ++ vrend_printf("%s: Skipping compute shader execution due to missing shaders: %s\n", ++ __func__, ctx->debug_name); ++ return; ++ } ++ + vrend_use_program(ctx, ctx->sub->prog->id); + + vrend_draw_bind_ubo_shader(ctx, PIPE_SHADER_COMPUTE, 0); +-- +2.24.1 +
meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb +3 -0
@@ -8,6 +8,9 @@ DEPENDS = "libdrm mesa libepoxy" SRCREV = "48cc96c9aebb9d0164830a157efc8916f08f00c0" SRC_URI = "git://anongit.freedesktop.org/virglrenderer \ file://0001-gallium-Expand-libc-check-to-be-platform-OS-check.patch \ + file://CVE-2019-18390.patch \ + file://CVE-2019-18391.patch \ + file://CVE-2020-8002.patch \ " S = "${WORKDIR}/git"
Signature · 1 line
2.17.1
PATCH 13/16 maintainers: Add entry for buildtools-extended-tarball
In reply to Armin KusterFrom: Richard Purdie <[email protected]>
--- meta/conf/distro/include/maintainers.inc | 1 + 1 file changed, 1 insertion(+)
meta/conf/distro/include/maintainers.inc +1 -0
@@ -82,6 +82,7 @@ RECIPE_MAINTAINER_pn-build-appliance-image = "Richard Purdie <richard.purdie@lin RECIPE_MAINTAINER_pn-build-compare = "Paul Eggleton <[email protected]>" RECIPE_MAINTAINER_pn-build-sysroots = "Richard Purdie <[email protected]>" RECIPE_MAINTAINER_pn-builder = "Richard Purdie <[email protected]>" +RECIPE_MAINTAINER_pn-buildtools-extended-tarball = "Richard Purdie <[email protected]>" RECIPE_MAINTAINER_pn-buildtools-tarball = "Richard Purdie <[email protected]>" RECIPE_MAINTAINER_pn-busybox = "Andrej Valek <[email protected]>" RECIPE_MAINTAINER_pn-busybox-inittab = "Denys Dmytriyenko <[email protected]>"
Signature · 1 line
2.17.1
PATCH 14/16 glibc: CVE-2020-10029
In reply to Armin KusterFrom: Zhixiong Chi <[email protected]>
Backport the CVE patch from upstream:
[https://sourceware.org/git/gitweb.cgi?p=glibc.git;
a=patch;h=9333498794cde1d5cca518badf79533a24114b6f]
--- .../glibc/glibc/CVE-2020-10029.patch | 128 ++++++++++++++++++ meta/recipes-core/glibc/glibc_2.30.bb | 1 + 2 files changed, 129 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/CVE-2020-10029.patch
meta/recipes-core/glibc/glibc/CVE-2020-10029.patch new file +128 -0
@@ -0,0 +1,128 @@ +From ce265ec5bc25ec35fba53807abac1b0c8469895e Mon Sep 17 00:00:00 2001 +From: Joseph Myers <[email protected]> +Date: Wed, 12 Feb 2020 23:31:56 +0000 +Subject: [PATCH] Avoid ldbl-96 stack corruption from range reduction of + + pseudo-zero (bug 25487). + +Bug 25487 reports stack corruption in ldbl-96 sinl on a pseudo-zero +argument (an representation where all the significand bits, including +the explicit high bit, are zero, but the exponent is not zero, which +is not a valid representation for the long double type). + +Although this is not a valid long double representation, existing +practice in this area (see bug 4586, originally marked invalid but +subsequently fixed) is that we still seek to avoid invalid memory +accesses as a result, in case of programs that treat arbitrary binary +data as long double representations, although the invalid +representations of the ldbl-96 format do not need to be consistently +handled the same as any particular valid representation. + +This patch makes the range reduction detect pseudo-zero and unnormal +representations that would otherwise go to __kernel_rem_pio2, and +returns a NaN for them instead of continuing with the range reduction +process. (Pseudo-zero and unnormal representations whose unbiased +exponent is less than -1 have already been safely returned from the +function before this point without going through the rest of range +reduction.) Pseudo-zero representations would previously result in +the value passed to __kernel_rem_pio2 being all-zero, which is +definitely unsafe; unnormal representations would previously result in +a value passed whose high bit is zero, which might well be unsafe +since that is not a form of input expected by __kernel_rem_pio2. + +Tested for x86_64. + +CVE: CVE-2020-10029 +Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=glibc.git; +a=patch;h=9333498794cde1d5cca518badf79533a24114b6f] +Signed-off-by: Zhixiong Chi <[email protected]> + +--- + sysdeps/ieee754/ldbl-96/Makefile | 3 ++- + sysdeps/ieee754/ldbl-96/e_rem_pio2l.c | 12 +++++++++ + sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c | 41 ++++++++++++++++++++++++++++++ + 3 files changed, 55 insertions(+), 1 deletion(-) + create mode 100644 sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c + +diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile +index b103254..052c1c7 100644 +--- a/sysdeps/ieee754/ldbl-96/Makefile ++++ b/sysdeps/ieee754/ldbl-96/Makefile +@@ -17,5 +17,6 @@ + # <http://www.gnu.org/licenses/>. + + ifeq ($(subdir),math) +-tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96 ++tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96 test-sinl-pseudo ++CFLAGS-test-sinl-pseudo.c += -fstack-protector-all + endif +diff --git a/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c +index 805de22..1aeccb4 100644 +--- a/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c ++++ b/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c +@@ -210,6 +210,18 @@ __ieee754_rem_pio2l (long double x, long double *y) + return 0; + } + ++ if ((i0 & 0x80000000) == 0) ++ { ++ /* Pseudo-zero and unnormal representations are not valid ++ representations of long double. We need to avoid stack ++ corruption in __kernel_rem_pio2, which expects input in a ++ particular normal form, but those representations do not need ++ to be consistently handled like any particular floating-point ++ value. */ ++ y[1] = y[0] = __builtin_nanl (""); ++ return 0; ++ } ++ + /* Split the 64 bits of the mantissa into three 24-bit integers + stored in a double array. */ + exp = j0 - 23; +diff --git a/sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c b/sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c +new file mode 100644 +index 0000000..f59b977 +--- /dev/null ++++ b/sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c +@@ -0,0 +1,41 @@ ++/* Test sinl for pseudo-zeros and unnormals for ldbl-96 (bug 25487). ++ Copyright (C) 2020 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <https://www.gnu.org/licenses/>. */ ++ ++#include <math.h> ++#include <math_ldbl.h> ++#include <stdint.h> ++ ++static int ++do_test (void) ++{ ++ for (int i = 0; i < 64; i++) ++ { ++ uint64_t sig = i == 63 ? 0 : 1ULL << i; ++ long double ld; ++ SET_LDOUBLE_WORDS (ld, 0x4141, ++ sig >> 32, sig & 0xffffffffULL); ++ /* The requirement is that no stack overflow occurs when the ++ pseudo-zero or unnormal goes through range reduction. */ ++ volatile long double ldr; ++ ldr = sinl (ld); ++ (void) ldr; ++ } ++ return 0; ++} ++ ++#include <support/test-driver.c>
meta/recipes-core/glibc/glibc_2.30.bb +1 -0
@@ -42,6 +42,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0027-inject-file-assembly-directives.patch \ file://0028-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \ file://CVE-2019-19126.patch \ + file://CVE-2020-10029.patch \ " S = "${WORKDIR}/git" B = "${WORKDIR}/build-${TARGET_SYS}"
Signature · 1 line
2.17.1
PATCH 15/16 cve-check: show whitelisted status
In reply to Armin KusterFrom: Chee Yang Lee <[email protected]>
change whitelisted CVE status from "Patched" to "Whitelisted".
[Yocto #13687]
--- meta/classes/cve-check.bbclass | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
meta/classes/cve-check.bbclass +7 -5
@@ -56,10 +56,10 @@ python do_cve_check () { patched_cves = get_patches_cves(d) except FileNotFoundError: bb.fatal("Failure in searching patches") - patched, unpatched = check_cves(d, patched_cves) + whitelisted, patched, unpatched = check_cves(d, patched_cves) if patched or unpatched: cve_data = get_cve_info(d, patched + unpatched) - cve_write_data(d, patched, unpatched, cve_data) + cve_write_data(d, patched, unpatched, whitelisted, cve_data) else: bb.note("No CVE database found, skipping CVE check")
@@ -263,7 +263,7 @@ def check_cves(d, patched_cves): conn.close() - return (list(patched_cves), cves_unpatched) + return (list(cve_whitelist), list(patched_cves), cves_unpatched) def get_cve_info(d, cves): """
@@ -287,7 +287,7 @@ def get_cve_info(d, cves): conn.close() return cve_data -def cve_write_data(d, patched, unpatched, cve_data): +def cve_write_data(d, patched, unpatched, whitelisted, cve_data): """ Write CVE information in WORKDIR; and to CVE_CHECK_DIR, and CVE manifest if enabled.
@@ -303,7 +303,9 @@ def cve_write_data(d, patched, unpatched, cve_data): write_string += "PACKAGE NAME: %s\n" % d.getVar("PN") write_string += "PACKAGE VERSION: %s\n" % d.getVar("PV") write_string += "CVE: %s\n" % cve - if cve in patched: + if cve in whitelisted: + write_string += "CVE STATUS: Whitelisted\n" + elif cve in patched: write_string += "CVE STATUS: Patched\n" else: unpatched_cves.append(cve)
Signature · 1 line
2.17.1
PATCH 16/16 cve-check: fix ValueError
In reply to Armin KusterFrom: Chee Yang Lee <[email protected]>
fix below error for whitelisted recipe and recipe skip cve check.
Error:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:do_cve_check(d)
0003:File: '/poky-master/meta/classes/cve-check.bbclass', lineno: 59, function: do_cve_check
0055: try:
0056: patched_cves = get_patches_cves(d)
0057: except FileNotFoundError:
0058: bb.fatal("Failure in searching patches")
*** 0059: whitelisted, patched, unpatched = check_cves(d, patched_cves)
0060: if patched or unpatched:
0061: cve_data = get_cve_info(d, patched + unpatched)
0062: cve_write_data(d, patched, unpatched, whitelisted, cve_data)
0063: else:
Exception: ValueError: not enough values to unpack (expected 3, got 2)
--- meta/classes/cve-check.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/cve-check.bbclass +2 -2
@@ -179,13 +179,13 @@ def check_cves(d, patched_cves): products = d.getVar("CVE_PRODUCT").split() # If this has been unset then we're not scanning for CVEs here (for example, image recipes) if not products: - return ([], []) + return ([], [], []) pv = d.getVar("CVE_VERSION").split("+git")[0] # If the recipe has been whitlisted we return empty lists if d.getVar("PN") in d.getVar("CVE_CHECK_PN_WHITELIST").split(): bb.note("Recipe has been whitelisted, skipping check") - return ([], []) + return ([], [], []) old_cve_whitelist = d.getVar("CVE_CHECK_CVE_WHITELIST") if old_cve_whitelist:
Signature · 1 line
2.17.1