Patch review
cover Patch review
Please review this set of patches for dunfell and have comments back by end of day Tuesday.
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3790
The following changes since commit 7e056e79a5acce8261cb5124c172cc40ad608b82:
linux-yocto/5.4: update to v5.4.196 (2022-06-07 08:56:30 -1000)
are available in the Git repository at:
git://git.openembedded.org/openembedded-core-contrib stable/dunfell-nut
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=stable/dunfell-nut
Jose Quaresma (2):
archiver: use bb.note instead of echo
archiver: don't use machine variables in shared recipes
Marcel Ziswiler (1):
alsa-plugins: fix libavtp vs. avtp packageconfig
Martin Jansa (1):
rootfs.py: close kernel_abi_ver_file
Mingli Yu (1):
oescripts: change compare logic in OEListPackageconfigTests
Pawan Badganchi (1):
openssh: Whitelist CVE-2021-36368
Peter Kjellerstedt (1):
license.bbclass: Bound beginline and endline in copy_license_files()
Rasmus Villemoes (1):
e2fsprogs: add alternatives handling of lsattr as well
Richard Purdie (2):
vim: Upgrade 8.2.5034 -> 8.2.5083
gcc-source: Fix incorrect task dependencies from ${B}
Stefan Wiehler (1):
kernel-yocto.bbclass: Reset to exiting on non-zero return code at end
of task
Steve Sakoman (1):
cups: fix CVE-2022-26691
meta/classes/archiver.bbclass | 11 +++++-- meta/classes/kernel-yocto.bbclass | 8 +++++ meta/classes/license.bbclass | 8 ++--- meta/lib/oe/rootfs.py | 4 ++- meta/lib/oeqa/selftest/cases/oescripts.py | 3 +- .../openssh/openssh_8.2p1.bb | 7 ++++ .../e2fsprogs/e2fsprogs_1.45.7.bb | 5 ++- meta/recipes-devtools/gcc/gcc-common.inc | 2 +- meta/recipes-devtools/gcc/gcc-source.inc | 1 + meta/recipes-extended/cups/cups.inc | 3 +- .../cups/cups/CVE-2022-26691.patch | 33 +++++++++++++++++++ .../alsa/alsa-plugins_1.2.1.bb | 2 +- meta/recipes-support/vim/vim.inc | 4 +-- 13 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 meta/recipes-extended/cups/cups/CVE-2022-26691.patch
Signature · 1 line
2.25.1
PATCH 1/12 cups: fix CVE-2022-26691
In scheduler/cert.c the previous algorithm didn't expect the strings can have a different length, so one string can be a substring of the other and such substring was reported as equal to the longer string.
Backport patch from upstream to fix:
https://github.com/OpenPrinting/cups/commit/de4f8c196106033e4c372dce3e91b9d42b0b9444
CVE: CVE-2022-26691
--- meta/recipes-extended/cups/cups.inc | 3 +- .../cups/cups/CVE-2022-26691.patch | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-extended/cups/cups/CVE-2022-26691.patch
meta/recipes-extended/cups/cups.inc +2 -1
@@ -13,6 +13,7 @@ SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.t file://0002-don-t-try-to-run-generated-binaries.patch \ file://0003-cups_1.4.6.bb-Fix-build-on-ppc64.patch \ file://0004-cups-fix-multilib-install-file-conflicts.patch\ + file://CVE-2022-26691.patch \ " UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases"
@@ -119,4 +120,4 @@ cups_sysroot_preprocess () { # -25317 concerns /var/log/cups having lp ownership. Our /var/log/cups is # root:root, so this doesn't apply. -CVE_CHECK_WHITELIST += "CVE-2021-25317" +CVE_CHECK_WHITELIST += "CVE-2021-25317"
meta/recipes-extended/cups/cups/CVE-2022-26691.patch new file +33 -0
@@ -0,0 +1,33 @@ +From de4f8c196106033e4c372dce3e91b9d42b0b9444 Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal <[email protected]> +Date: Thu, 26 May 2022 06:27:04 +0200 +Subject: [PATCH] scheduler/cert.c: Fix string comparison (fixes + CVE-2022-26691) + +The previous algorithm didn't expect the strings can have a different +length, so one string can be a substring of the other and such substring +was reported as equal to the longer string. + +CVE: CVE-2022-26691 +Upstream-Status: Backport [https://github.com/OpenPrinting/cups/commit/de4f8c196106033e4c372dce3e91b9d42b0b9444] +Signed-off-by: Steve Sakoman + +--- +diff --git a/scheduler/cert.c b/scheduler/cert.c +index b268bf1b2..9b65b96c9 100644 +--- a/scheduler/cert.c ++++ b/scheduler/cert.c +@@ -434,5 +434,12 @@ ctcompare(const char *a, /* I - First string */ + b ++; + } + +- return (result); ++ /* ++ * The while loop finishes when *a == '\0' or *b == '\0' ++ * so after the while loop either both *a and *b == '\0', ++ * or one points inside a string, so when we apply logical OR on *a, ++ * *b and result, we get a non-zero return value if the compared strings don't match. ++ */ ++ ++ return (result | *a | *b); + }
Signature · 1 line
2.25.1
PATCH 2/12 openssh: Whitelist CVE-2021-36368
In reply to Steve SakomanFrom: Pawan Badganchi <[email protected]>
As per debian, the issue is fixed by a feature called "agent restriction" in openssh 8.9.
Urgency is unimportant as per debian, Hence this CVE is whitelisting. Link:
https://security-tracker.debian.org/tracker/CVE-2021-36368
https://bugzilla.mindrot.org/show_bug.cgi?id=3316#c2
https://docs.ssh-mitm.at/trivialauth.html
--- meta/recipes-connectivity/openssh/openssh_8.2p1.bb | 7 +++++++ 1 file changed, 7 insertions(+)
meta/recipes-connectivity/openssh/openssh_8.2p1.bb +7 -0
@@ -60,6 +60,13 @@ CVE_CHECK_WHITELIST += "CVE-2008-3844" # https://ubuntu.com/security/CVE-2016-20012 CVE_CHECK_WHITELIST += "CVE-2016-20012" +# As per debian, the issue is fixed by a feature called "agent restriction" in openssh 8.9 +# Urgency is unimportant as per debian, Hence this CVE is whitelisting. +# https://security-tracker.debian.org/tracker/CVE-2021-36368 +# https://bugzilla.mindrot.org/show_bug.cgi?id=3316#c2 +# https://docs.ssh-mitm.at/trivialauth.html +CVE_CHECK_WHITELIST += "CVE-2021-36368" + PAM_SRC_URI = "file://sshd" inherit manpages useradd update-rc.d update-alternatives systemd
Signature · 1 line
2.25.1
PATCH 3/12 vim: Upgrade 8.2.5034 -> 8.2.5083
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
Includes fixes for CVE-2022-1927, CVE-2022-1942.
--- meta/recipes-support/vim/vim.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-support/vim/vim.inc +2 -2
@@ -21,8 +21,8 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \ file://racefix.patch \ " -PV .= ".5034" -SRCREV = "5a6ec10cc80ab02eeff644ab19b82312630ea855" +PV .= ".5083" +SRCREV = "db77c49401145d76441fbb3d22a1d7d987681c13" # Remove when 8.3 is out UPSTREAM_VERSION_UNKNOWN = "1"
Signature · 1 line
2.25.1
PATCH 4/12 kernel-yocto.bbclass: Reset to exiting on non-zero return code at end of task
In reply to Steve SakomanFrom: Stefan Wiehler <[email protected]>
Several tasks deactivate exiting on non-zero return codes via set +e because they run subcommands that have legitimate non-zero return codes. However when appending to those tasks, this behavior is not expected and can lead to builds silently proceeding in case of an error. Therefore reset the default behavior at the end of the respective tasks via set -e.
--- meta/classes/kernel-yocto.bbclass | 8 ++++++++ 1 file changed, 8 insertions(+)
meta/classes/kernel-yocto.bbclass +8 -0
@@ -269,6 +269,8 @@ do_kernel_metadata() { bbnote "KERNEL_FEATURES: $KERNEL_FEATURES_FINAL" bbnote "Final scc/cfg list: $sccs_defconfig $bsp_definition $sccs $KERNEL_FEATURES_FINAL" fi + + set -e } do_patch() {
@@ -298,6 +300,8 @@ do_patch() { fi done fi + + set -e } do_kernel_checkout() {
@@ -356,6 +360,8 @@ do_kernel_checkout() { git commit -q -m "baseline commit: creating repo for ${PN}-${PV}" git clean -d -f fi + + set -e } do_kernel_checkout[dirs] = "${S}"
@@ -523,6 +529,8 @@ do_validate_branches() { kgit-s2q --clean fi fi + + set -e } OE_TERMINAL_EXPORTS += "KBUILD_OUTPUT"
Signature · 1 line
2.25.1
PATCH 5/12 alsa-plugins: fix libavtp vs. avtp packageconfig
In reply to Steve SakomanFrom: Marcel Ziswiler <[email protected]>
Fix PACKAGECONFIG to refer to libavtp instead of avtp as this is what the project and everything is really called everywhere.
--- meta/recipes-multimedia/alsa/alsa-plugins_1.2.1.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-multimedia/alsa/alsa-plugins_1.2.1.bb +1 -1
@@ -36,7 +36,7 @@ PACKAGECONFIG ??= "\ speexdsp \ ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \ " -PACKAGECONFIG[aaf] = "--enable-aaf,--disable-aaf,avtp" +PACKAGECONFIG[aaf] = "--enable-aaf,--disable-aaf,libavtp" PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack" PACKAGECONFIG[libav] = "--enable-libav,--disable-libav,libav" PACKAGECONFIG[maemo-plugin] = "--enable-maemo-plugin,--disable-maemo-plugin"
Signature · 1 line
2.25.1
PATCH 6/12 license.bbclass: Bound beginline and endline in copy_license_files()
In reply to Steve SakomanFrom: Peter Kjellerstedt <[email protected]>
Ensure that begin_idx (i.e., beginline - 1) and end_idx (i.e., endline) are positive numbers in copy_license_files(). This makes sure the same lines are copied as populate_lic_qa_checksum() uses when it calculates the checksum. Before, beginline=0 would typically lead to that no lines were copied at all.
--- meta/classes/license.bbclass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/license.bbclass +4 -4
@@ -91,17 +91,17 @@ def copy_license_files(lic_files_paths, destdir): os.link(src, dst) except OSError as err: if err.errno == errno.EXDEV: - # Copy license files if hard-link is not possible even if st_dev is the + # Copy license files if hardlink is not possible even if st_dev is the # same on source and destination (docker container with device-mapper?) canlink = False else: raise - # Only chown if we did hardling, and, we're running under pseudo + # Only chown if we did hardlink and we're running under pseudo if canlink and os.environ.get('PSEUDO_DISABLED') == '0': os.chown(dst,0,0) if not canlink: - begin_idx = int(beginline)-1 if beginline is not None else None - end_idx = int(endline) if endline is not None else None + begin_idx = max(0, int(beginline) - 1) if beginline is not None else None + end_idx = max(0, int(endline)) if endline is not None else None if begin_idx is None and end_idx is None: shutil.copyfile(src, dst) else:
Signature · 1 line
2.25.1
PATCH 7/12 rootfs.py: close kernel_abi_ver_file
In reply to Steve SakomanFrom: Martin Jansa <[email protected]>
* fixes:
oe-core/meta/lib/oe/rootfs.py:331: ResourceWarning: unclosed file <_io.TextIOWrapper name='pkgdata/mach/kernel-depmod/kernel-abiversion' mode='r' encoding='UTF-8'> kernel_ver = open(kernel_abi_ver_file).read().strip(' \n')
--- meta/lib/oe/rootfs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meta/lib/oe/rootfs.py +3 -1
@@ -321,7 +321,9 @@ class Rootfs(object, metaclass=ABCMeta): if not os.path.exists(kernel_abi_ver_file): bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file) - kernel_ver = open(kernel_abi_ver_file).read().strip(' \n') + with open(kernel_abi_ver_file) as f: + kernel_ver = f.read().strip(' \n') + versioned_modules_dir = os.path.join(self.image_rootfs, modules_dir, kernel_ver) bb.utils.mkdirhier(versioned_modules_dir)
Signature · 1 line
2.25.1
PATCH 8/12 archiver: use bb.note instead of echo
In reply to Steve SakomanFrom: Jose Quaresma <[email protected]>
--- meta/classes/archiver.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/archiver.bbclass +1 -1
@@ -578,7 +578,7 @@ python do_dumpdata () { SSTATETASKS += "do_deploy_archives" do_deploy_archives () { - echo "Deploying source archive files from ${ARCHIVER_TOPDIR} to ${DEPLOY_DIR_SRC}." + bbnote "Deploying source archive files from ${ARCHIVER_TOPDIR} to ${DEPLOY_DIR_SRC}." } python do_deploy_archives_setscene () { sstate_setscene(d)
Signature · 1 line
2.25.1
PATCH 9/12 oescripts: change compare logic in OEListPackageconfigTests
In reply to Steve SakomanFrom: Mingli Yu <[email protected]>
When multilib enabled and add layers/meta-openembedded/meta-oe in conf/bblayers.conf, it reports below error when run oe-selftest.
$ oe-selftest -r oescripts [snip] [20:36:33-0700] 2022-05-16 03:36:33,494 - oe-selftest - INFO - RESULTS - oescripts.OEListPackageconfigTests.test_packageconfig_flags_option_flags: FAILED (585.37s) [snip]
It is because the output of "list-packageconfig-flags.py -f" as below:
$ ../scripts/contrib/list-packageconfig-flags.py -f [snip] qt lib32-pinentry lib32-wxwidgets nativesdk-pinentry pinentry pinentry-native wxwidgets wxwidgets-native secret lib32-pinentry nativesdk-pinentry pinentry pinentry-native [snip]
But the check logic as below:
class OEListPackageconfigTests(OEScriptTests):
#oe-core.scripts.List_all_the_PACKAGECONFIG's_flags def check_endlines(self, results, expected_endlines):
for line in results.output.splitlines():
for el in expected_endlines:
if line.split() == el.split():
expected_endlines.remove(el) break
def test_packageconfig_flags_option_flags(self):
results = runCmd('%s/contrib/list-packageconfig-flags.py -f' % self.scripts_dir) expected_endlines = []
expected_endlines.append("PACKAGECONFIG FLAG RECIPE NAMES")
expected_endlines.append("qt nativesdk-pinentry pinentry pinentry-native")
expected_endlines.append("secret nativesdk-pinentry pinentry pinentry-native")
self.check_endlines(results, expected_endlines)
And the test will fail as line.split() doesn't equal el.split() as line.split() is ['lib32-pinentry', 'lib32-wxwidgets', 'nativesdk-pinentry', 'pinentry', 'pinentry-native', 'wxwidgets', 'wxwidgets-native'] and el.split() is ['nativesdk-pinentry', 'pinentry', 'pinentry-native'].
So change the compare logic to fix the gap.
--- meta/lib/oeqa/selftest/cases/oescripts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/oescripts.py +2 -1
@@ -133,7 +133,8 @@ class OEListPackageconfigTests(OEScriptTests): def check_endlines(self, results, expected_endlines): for line in results.output.splitlines(): for el in expected_endlines: - if line.split() == el.split(): + if line and line.split()[0] == el.split()[0] and \ + ' '.join(sorted(el.split())) in ' '.join(sorted(line.split())): expected_endlines.remove(el) break
Signature · 1 line
2.25.1
PATCH 10/12 e2fsprogs: add alternatives handling of lsattr as well
In reply to Steve SakomanFrom: Rasmus Villemoes <[email protected]>
Building busybox with CONFIG_LSATTR=y and installing that in the same filesystem as e2fsprogs breaks:
ERROR: ... do_rootfs: Postinstall scriptlets of ['busybox'] have failed. If the intention is to defer them to first boot, then please place them into pkg_postinst_ontarget:${PN} ().
Deferring to first boot via 'exit 1' is no longer supported.
Fix that by also alternatifying lsattr just as chattr already is.
--- meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb +4 -1
@@ -54,6 +54,7 @@ do_install () { oe_multilib_header ext2fs/ext2_types.h install -d ${D}${base_bindir} mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs + mv ${D}${bindir}/lsattr ${D}${base_bindir}/lsattr.e2fsprogs install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/
@@ -102,10 +103,12 @@ FILES_libe2p = "${base_libdir}/libe2p.so.*" FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*" FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so ${bindir}/compile_et ${bindir}/mk_cmds" -ALTERNATIVE_${PN} = "chattr" +ALTERNATIVE_${PN} = "chattr lsattr" ALTERNATIVE_PRIORITY = "100" ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr" ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs" +ALTERNATIVE_LINK_NAME[lsattr] = "${base_bindir}/lsattr" +ALTERNATIVE_TARGET[lsattr] = "${base_bindir}/lsattr.e2fsprogs" ALTERNATIVE_${PN}-doc = "fsck.8" ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
Signature · 1 line
2.25.1
PATCH 11/12 gcc-source: Fix incorrect task dependencies from ${B}
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
Some tasks may reference ${B} for gcc-source which in general would not exist. It has dependencies on HOST_SYS and TARGET_SYS which are not appropriate for a shared recipe like gcc-source. This causes problems for the archiver and multiconfigs in particlar.
Set B to something else to avoid these task hash issues.
--- meta/recipes-devtools/gcc/gcc-common.inc | 2 +- meta/recipes-devtools/gcc/gcc-source.inc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/gcc/gcc-common.inc +1 -1
@@ -100,7 +100,7 @@ BINV = "${PV}" #S = "${WORKDIR}/gcc-${PV}" S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" -B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" +B ?= "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" target_includedir ?= "${includedir}" target_libdir ?= "${libdir}"
meta/recipes-devtools/gcc/gcc-source.inc +1 -0
@@ -18,6 +18,7 @@ INHIBIT_DEFAULT_DEPS = "1" DEPENDS = "" PACKAGES = "" +B = "${WORKDIR}/build" # This needs to be Python to avoid lots of shell variables becoming dependencies. python do_preconfigure () {
Signature · 1 line
2.25.1
PATCH 12/12 archiver: don't use machine variables in shared recipes
In reply to Steve SakomanFrom: Jose Quaresma <[email protected]>
When using multiconfig with the same TMP folder we can have races because the shared recipes like gcc-source run twice.
ARCHIVER_OUTDIR = ${ARCHIVER_TOPDIR}/${TARGET_SYS}/${PF}/ which includes TARGET_SYS and between the two different MACHINE values, this changes from 'arm-poky-linux-gnueabi' to 'aarch64-poky-linux'. This leads to the task running twice, once for each multiconfig.
To solve this we need to store the shared output in a common place for all machines and in this way the stamps will be the same for each machine so the gcc-source will on run once regardless of the machine used.
--- meta/classes/archiver.bbclass | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
meta/classes/archiver.bbclass +7 -2
@@ -54,9 +54,10 @@ ARCHIVER_MODE[mirror] ?= "split" DEPLOY_DIR_SRC ?= "${DEPLOY_DIR}/sources" ARCHIVER_TOPDIR ?= "${WORKDIR}/archiver-sources" -ARCHIVER_OUTDIR = "${ARCHIVER_TOPDIR}/${TARGET_SYS}/${PF}/" +ARCHIVER_ARCH = "${TARGET_SYS}" +ARCHIVER_OUTDIR = "${ARCHIVER_TOPDIR}/${ARCHIVER_ARCH}/${PF}/" ARCHIVER_RPMTOPDIR ?= "${WORKDIR}/deploy-sources-rpm" -ARCHIVER_RPMOUTDIR = "${ARCHIVER_RPMTOPDIR}/${TARGET_SYS}/${PF}/" +ARCHIVER_RPMOUTDIR = "${ARCHIVER_RPMTOPDIR}/${ARCHIVER_ARCH}/${PF}/" ARCHIVER_WORKDIR = "${WORKDIR}/archiver-work/" # When producing a combined mirror directory, allow duplicates for the case
@@ -100,6 +101,10 @@ python () { bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn) return + # TARGET_SYS in ARCHIVER_ARCH will break the stamp for gcc-source in multiconfig + if pn.startswith('gcc-source'): + d.setVar('ARCHIVER_ARCH', "allarch") + def hasTask(task): return bool(d.getVarFlag(task, "task", False)) and not bool(d.getVarFlag(task, "noexec", False))
Signature · 1 line
2.25.1