Skip to contentSkip to conversation

Review request

PATCH New Anuj Mittal 1 participant 11 messages Sep 29, 2021

lore
Share & tools
lore
#0 lore raw

cover Review request

Please review these changes for hardknott. One intermittent failure seen when running SDK tests on Centos-8 but that doesn't look related to these changes.

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/2660

Thanks,

Anuj

The following changes since commit 437f5e04c92158d3c9e27fe6252260a02a108391:

ffmpeg: fix CVE-2021-38114 (2021-09-24 10:17:24 +0100)

are available in the Git repository at:

git://push.openembedded.org/openembedded-core-contrib anujm/hardknott

Konrad Weihmann (1):
expat: pull from github releases

Mingli Yu (1):
vim: fix CVEs

Richard Purdie (5):
pybootchart: Avoid divide by zero oeqa/qemurunner: Use oe._exit(), not sys.exit() oeqa/selftest/gotoolchain: Fix temp file cleanup oeqa/buildproject: Ensure temp directories are cleaned up
bash: Ensure deterministic build

Steve Sakoman (1):
connman: add CVE_PRODUCT

Tom Pollard (2):
bzip2: Update soname for libbz2 1.0.8
libsamplerate0: Set correct soname for 0.1.9

 meta/lib/oeqa/selftest/cases/gotoolchain.py   |  6 +++
 meta/lib/oeqa/utils/buildproject.py           |  3 ++
 meta/lib/oeqa/utils/qemurunner.py             |  2 +-
 meta/lib/oeqa/utils/targetbuild.py            |  4 +-
 meta/recipes-connectivity/connman/connman.inc |  2 +
 meta/recipes-core/expat/expat_2.2.10.bb       |  6 ++-
 meta/recipes-extended/bash/bash.inc           |  5 ++
 meta/recipes-extended/bzip2/bzip2/Makefile.am |  2 +-
 .../libsamplerate0/shared_version_info.patch  | 13 +++++
 .../libsamplerate/libsamplerate0_0.1.9.bb     |  1 +
 .../vim/files/CVE-2021-3778.patch             | 34 +++++++++++++
 .../vim/files/CVE-2021-3796.patch             | 50 +++++++++++++++++++
 meta/recipes-support/vim/vim.inc              |  2 +
 scripts/pybootchartgui/pybootchartgui/draw.py |  5 +-
 14 files changed, 130 insertions(+), 5 deletions(-)
 create mode 100644 meta/recipes-multimedia/libsamplerate/libsamplerate0/shared_version_info.patch
 create mode 100644 meta/recipes-support/vim/files/CVE-2021-3778.patch
 create mode 100644 meta/recipes-support/vim/files/CVE-2021-3796.patch
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/10 vim: fix CVEs

From: Mingli Yu <[email protected]>

Backport patches to fix CVE-2021-3778 and CVE-2021-3796.

---
 .../vim/files/CVE-2021-3778.patch             | 34 +++++++++++++
 .../vim/files/CVE-2021-3796.patch             | 50 +++++++++++++++++++
 meta/recipes-support/vim/vim.inc              |  2 +
 3 files changed, 86 insertions(+)
 create mode 100644 meta/recipes-support/vim/files/CVE-2021-3778.patch
 create mode 100644 meta/recipes-support/vim/files/CVE-2021-3796.patch
meta/recipes-support/vim/files/CVE-2021-3778.patch new file +34 -0
new file mode 100644
index 0000000000..04ac413e56
@@ -0,0 +1,34 @@
+From 9ba62f1042513fcadcc4e8fdcee171db66ef1d69 Mon Sep 17 00:00:00 2001
+From: Bram Moolenaar <[email protected]>
+Date: Fri, 24 Sep 2021 15:15:24 +0800
+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: Backport [https://github.com/vim/vim/commit/65b605665997fad54ef39a93199e305af2fe4d7f]
+CVE: CVE-2021-3778
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ src/regexp_nfa.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
+index fb512f961..2806408de 100644
+--- a/src/regexp_nfa.c
++++ b/src/regexp_nfa.c
+@@ -5455,7 +5455,8 @@ find_match_text(colnr_T startcol, int regstart, char_u *match_text)
+ 		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
+-- 
+2.17.1
+
meta/recipes-support/vim/files/CVE-2021-3796.patch new file +50 -0

50 lines not on this page · raw message

meta/recipes-support/vim/vim.inc +2 -0
index 6fe8fb90db..e45f9b828d 100644
@@ -17,6 +17,8 @@ SRC_URI = "git://github.com/vim/vim.git \
            file://0001-src-Makefile-improve-reproducibility.patch \
            file://no-path-adjust.patch \
            file://racefix.patch \
+           file://CVE-2021-3778.patch \
+           file://CVE-2021-3796.patch \
 "
 SRCREV = "98056533b96b6b5d8849641de93185dd7bcadc44"
 
Signature · 1 line
2.31.1
#2 lore raw

PATCH 2/10 connman: add CVE_PRODUCT

In reply to Anuj Mittal

From: Steve Sakoman <[email protected]>

Upstream database uses both "connman" and "connection_manager" to report CVEs

(cherry picked from commit eadf7bb17289731be9747822e3d4084ab69cf109)
---
 meta/recipes-connectivity/connman/connman.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-connectivity/connman/connman.inc +2 -0
index 776bbfbff2..bd1dfd5b01 100644
@@ -15,6 +15,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
 
 inherit autotools pkgconfig systemd update-rc.d update-alternatives
 
+CVE_PRODUCT = "connman connection_manager"
+
 DEPENDS  = "dbus glib-2.0 ppp"
 
 EXTRA_OECONF += "\
Signature · 1 line
2.31.1
#3 lore raw

PATCH 3/10 expat: pull from github releases

In reply to Anuj Mittal

From: Konrad Weihmann <[email protected]>

sometimes we can find release tarballs from sourceforge are not fully distributed along all download mirrors leading to fetching failures, depending on what download mirror will be chosen by sourceforge servers.
As the project moved to github anyway, it's better to pull the tarballs directly from github releases - serving the very same static artifacts.

Add an override UPSTREAM_CHECK_URI to enable devtool upgrade checks

(backported from commit 2a1743ace5aa41b188f77853d0f00c9e5a359c6d)
---
 meta/recipes-core/expat/expat_2.2.10.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-core/expat/expat_2.2.10.bb +5 -1
index a54d832e52..08e8ff1cea 100644
@@ -6,12 +6,16 @@ LICENSE = "MIT"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=9e2ce3b3c4c0f2670883a23bbd7c37a9"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.bz2 \
+VERSION_TAG = "${@d.getVar('PV').replace('.', '_')}"
+
+SRC_URI = "https://github.com/libexpat/libexpat/releases/download/R_${VERSION_TAG}/expat-${PV}.tar.bz2  \
            file://libtool-tag.patch \
 	   file://run-ptest \
 	   file://0001-Add-output-of-tests-result.patch \
 	  "
 
+UPSTREAM_CHECK_URI = "https://github.com/libexpat/libexpat/releases/"
+
 SRC_URI[sha256sum] = "b2c160f1b60e92da69de8e12333096aeb0c3bf692d41c60794de278af72135a5"
 
 EXTRA_OECMAKE_class-native += "-DEXPAT_BUILD_DOCS=OFF"
Signature · 1 line
2.31.1
#4 lore raw

PATCH 4/10 pybootchart: Avoid divide by zero

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

Avoid a rare divide by zero error if there isn't data point spread.

[YOCTO #14547]

(cherry picked from commit d7e36d01e87ddf89f76f164a0b7d98f597a53fa5)
---
 scripts/pybootchartgui/pybootchartgui/draw.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/pybootchartgui/pybootchartgui/draw.py +4 -1
index 29eb7505bc..fc708b55c3 100644
@@ -267,7 +267,10 @@ def draw_chart(ctx, color, fill, chart_bounds, data, proc_tree, data_range):
     # avoid divide by zero
     if max_y == 0:
         max_y = 1.0
-    xscale = float (chart_bounds[2]) / (max_x - x_shift)
+    if (max_x - x_shift):
+        xscale = float (chart_bounds[2]) / (max_x - x_shift)
+    else:
+        xscale = float (chart_bounds[2])
     # If data_range is given, scale the chart so that the value range in
     # data_range matches the chart bounds exactly.
     # Otherwise, scale so that the actual data matches the chart bounds.
Signature · 1 line
2.31.1
#5 lore raw

PATCH 5/10 bzip2: Update soname for libbz2 1.0.8

In reply to Anuj Mittal

From: Tom Pollard <[email protected]>

Set shared library name as libbz2.so.1.0.8, version in configure.ac already synced via do_configure PV substitution.

(cherry picked from commit 07e3abc9d282a54add69a6905ec4248f3104219f)
---
 meta/recipes-extended/bzip2/bzip2/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/bzip2/bzip2/Makefile.am +1 -1
index 7338df03eb..d12d3a45e4 100644
@@ -1,6 +1,6 @@
 
 lib_LTLIBRARIES = libbz2.la
-libbz2_la_LDFLAGS = -version-info 1:6:0
+libbz2_la_LDFLAGS = -version-info 1:8:0
 
 libbz2_la_SOURCES = blocksort.c  \
                     huffman.c    \
Signature · 1 line
2.31.1
#6 lore raw

PATCH 6/10 libsamplerate0: Set correct soname for 0.1.9

In reply to Anuj Mittal

From: Tom Pollard <[email protected]>

Manually patch SHARED_VERSION_INFO, which was missed in the 0.1.9 release and later incorrectly fixed until 0.2.1

(cherry picked from commit cb2e8efd316d44b9b1453882114856e0eb7b3500)
---
 .../libsamplerate0/shared_version_info.patch        | 13 +++++++++++++
 .../libsamplerate/libsamplerate0_0.1.9.bb           |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 meta/recipes-multimedia/libsamplerate/libsamplerate0/shared_version_info.patch
meta/recipes-multimedia/libsamplerate/libsamplerate0/shared_version_info.patch new file +13 -0
new file mode 100644
index 0000000000..b42d564b4b
@@ -0,0 +1,13 @@
+Index: libsamplerate-0.1.8/configure.ac
+===================================================================
+--- libsamplerate-0.1.8.orig/configure.ac
++++ libsamplerate-0.1.8/configure.ac
+@@ -53,7 +53,7 @@ AC_PROG_LN_S
+ #  6. If any interfaces have been removed since the last public release, then set age
+ #     to 0.
+ 
+-SHARED_VERSION_INFO="1:8:1"
++SHARED_VERSION_INFO="1:9:1"
+ 
+ 
+ 
meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.9.bb +1 -0
index 6dfc42b436..8345d6880f 100644
@@ -10,6 +10,7 @@ PR = "r1"
 
 SRC_URI = "http://www.mega-nerd.com/SRC/libsamplerate-${PV}.tar.gz \
            file://0001-configure.ac-improve-alsa-handling.patch \
+           file://shared_version_info.patch \
 "
 
 SRC_URI[md5sum] = "2b78ae9fe63b36b9fbb6267fad93f259"
Signature · 1 line
2.31.1
#7 lore raw

PATCH 7/10 oeqa/qemurunner: Use oe._exit(), not sys.exit()

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

sys.exit will cause finally statements and other code to run at exit. Since we're using os.fork() here, os._exit() is apprioriate in this codepath.

(cherry picked from commit ec08498ff29de9ccd23be88b9d7af3dab6bbb81e)
---
 meta/lib/oeqa/utils/qemurunner.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/utils/qemurunner.py +1 -1
index a0f17d557b..d6d47cfabb 100644
@@ -235,7 +235,7 @@ class QemuRunner:
             r = os.fdopen(r)
             x = r.read()
             os.killpg(os.getpgid(self.runqemu.pid), signal.SIGTERM)
-            sys.exit(0)
+            os._exit(0)
 
         self.logger.debug("runqemu started, pid is %s" % self.runqemu.pid)
         self.logger.debug("waiting at most %s seconds for qemu pid (%s)" %
Signature · 1 line
2.31.1
#8 lore raw

PATCH 8/10 oeqa/selftest/gotoolchain: Fix temp file cleanup

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

The go tests leave readonly files and directories behind. Fix this to allow cleanup.

[YOCTO #14575]

(cherry picked from commit 5680e95d7bd9fe00a797b2d0deb8cb4790027508)
---
 meta/lib/oeqa/selftest/cases/gotoolchain.py | 6 ++++++
 1 file changed, 6 insertions(+)
meta/lib/oeqa/selftest/cases/gotoolchain.py +6 -0
index 4fc3605f42..c809d7c9b1 100644
@@ -43,6 +43,12 @@ class oeGoToolchainSelfTest(OESelftestTestCase):
 
     @classmethod
     def tearDownClass(cls):
+        # Go creates file which are readonly
+        for dirpath, dirnames, filenames in os.walk(cls.tmpdir_SDKQA):
+            for filename in filenames + dirnames:
+                f = os.path.join(dirpath, filename)
+                if not os.path.islink(f):
+                    os.chmod(f, 0o775)
         shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True)
         super(oeGoToolchainSelfTest, cls).tearDownClass()
 
Signature · 1 line
2.31.1
#9 lore raw

PATCH 9/10 oeqa/buildproject: Ensure temp directories are cleaned up

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

(cherry picked from commit d10aff865120a5feecc42c24726bd119364e0188)
---
 meta/lib/oeqa/utils/buildproject.py | 3 +++
 meta/lib/oeqa/utils/targetbuild.py  | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
meta/lib/oeqa/utils/buildproject.py +3 -0
index e6d80cc8dc..dfb9661868 100644
@@ -18,6 +18,7 @@ class BuildProject(metaclass=ABCMeta):
     def __init__(self, uri, foldername=None, tmpdir=None, dl_dir=None):
         self.uri = uri
         self.archive = os.path.basename(uri)
+        self.tempdirobj = None
         if not tmpdir:
             self.tempdirobj = tempfile.TemporaryDirectory(prefix='buildproject-')
             tmpdir = self.tempdirobj.name
@@ -57,6 +58,8 @@ class BuildProject(metaclass=ABCMeta):
         return self._run('cd %s; make install %s' % (self.targetdir, install_args))
 
     def clean(self):
+        if self.tempdirobj:
+            self.tempdirobj.cleanup()
         if not self.needclean:
              return
         self._run('rm -rf %s' % self.targetdir)
meta/lib/oeqa/utils/targetbuild.py +3 -1
index 1055810ca3..09738add1d 100644
@@ -19,6 +19,7 @@ class BuildProject(metaclass=ABCMeta):
         self.d = d
         self.uri = uri
         self.archive = os.path.basename(uri)
+        self.tempdirobj = None
         if not tmpdir:
             tmpdir = self.d.getVar('WORKDIR')
             if not tmpdir:
@@ -71,9 +72,10 @@ class BuildProject(metaclass=ABCMeta):
         return self._run('cd %s; make install %s' % (self.targetdir, install_args))
 
     def clean(self):
+        if self.tempdirobj:
+            self.tempdirobj.cleanup()
         self._run('rm -rf %s' % self.targetdir)
         subprocess.check_call('rm -f %s' % self.localarchive, shell=True)
-        pass
 
 class TargetBuildProject(BuildProject):
 
Signature · 1 line
2.31.1
#10 lore raw

PATCH 10/10 bash: Ensure deterministic build

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

Bash keeps a count of the number of times make was invoked on a directory and changes the output versioning accordingly. We want deterministic output so disable this behaviour.

(cherry picked from commit 13a039e03195a47c750d5901e96fe81cf523481f)
---
 meta/recipes-extended/bash/bash.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-extended/bash/bash.inc +5 -0
index d3e1dfdb30..37871bcdca 100644
@@ -62,6 +62,11 @@ do_compile_ptest () {
 	oe_runmake buildtest
 }
 
+do_install_prepend () {
+	# Ensure determinism as this counter increases for each make call
+	rm -f ${B}/.build
+}
+
 do_install_append () {
 	# Move /usr/bin/bash to /bin/bash, if need
 	if [ "${base_bindir}" != "${bindir}" ]; then
Signature · 1 line
2.31.1