Skip to contentSkip to conversation

Patch review Dec 20

PATCH New akuster 1 participant 7 messages Dec 20, 2020

lore
Share & tools
lore

akuster

author
#0 lore raw

cover Patch review Dec 20

Please have comments back by Tuesday

The following changes since commit b9dcf17700014dec679307dc1247882dccd439ca:

Revert "numactl: Remove the recipe" (2020-11-05 09:00:37 -0800)

are available in the Git repository at:

git://git.openembedded.org/meta-openembedded-contrib stable/gatesgarth-nut
http://cgit.openembedded.org/meta-openembedded-contrib/log/?h=stable/gatesgarth-nut

Gianfranco (1):
dlt-daemon: add upstream patch to fix CVE-2020-29394

Hongxu Jia (1):
lvm2.inc: switch branch master to main

Max Kellermann (1):
php: remove the failing ${D}/${TMPDIR} code

Roland Hieber (1):
pcsc-lite: provide pcsc-lite-lib-native explicitly for native build

Yi Zhao (1):
minifi-cpp: depend on nettle and lz4

viatsk (1):
tcpdump: Patch for CVE-2020-8037

 ...ping-don-t-allocate-a-too-large-buff.patch | 70 +++++++++++++++++++
 .../recipes-support/tcpdump/tcpdump_4.9.3.bb  |  1 +
 meta-oe/recipes-devtools/php/php_7.4.9.bb     |  9 ---
 .../dlt-daemon/dlt-daemon/275.patch           | 38 ++++++++++
 .../dlt-daemon/dlt-daemon_2.18.5.bb           |  1 +
 .../minifi-cpp/minifi-cpp_0.7.0.bb            |  2 +-
 meta-oe/recipes-support/lvm2/lvm2.inc         |  2 +-
 .../pcsc-lite/pcsc-lite_1.9.0.bb              |  1 +
 8 files changed, 113 insertions(+), 11 deletions(-)
 create mode 100644 meta-networking/recipes-support/tcpdump/tcpdump/0001-PPP-When-un-escaping-don-t-allocate-a-too-large-buff.patch
 create mode 100644 meta-oe/recipes-extended/dlt-daemon/dlt-daemon/275.patch
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/6 lvm2.inc: switch branch master to main

From: Hongxu Jia <[email protected]>

Keep sync with upstream

---
 meta-oe/recipes-support/lvm2/lvm2.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-support/lvm2/lvm2.inc +1 -1
index 3c6c7edfc71..11ee7ca8bb7 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \
 
 DEPENDS += "libaio"
 
-SRC_URI = "git://sourceware.org/git/lvm2.git \
+SRC_URI = "git://sourceware.org/git/lvm2.git;branch=main \
            file://lvm.conf \
            file://0001-implement-libc-specific-reopen_stream.patch \
            file://0002-Guard-use-of-mallinfo-with-__GLIBC__.patch \
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/6 minifi-cpp: depend on nettle and lz4

In reply to akuster

From: Yi Zhao <[email protected]>

Add nettle and lz4 to DEPENDS to make the minifi extension archive support crypto and lz4.

---
 meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb +1 -1
index 3815220cb30..2b884e3a1b0 100644
@@ -7,7 +7,7 @@ SECTION = "console/network"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=f9534eb5f4ab800b573a37bffc62f3a7"
 
-DEPENDS = "virtual/crypt expat flex python3 bison-native libxml2"
+DEPENDS = "virtual/crypt expat flex python3 bison-native libxml2 nettle lz4"
 RDEPENDS_${PN} = "python3-core"
 
 SRCREV = "aa42957a2e227df41510047cece3cd606dc1cb6a"
Signature · 1 line
2.17.1
author
#3 lore raw

PATCH 3/6 php: remove the failing ${D}/${TMPDIR} code

In reply to akuster

From: Max Kellermann <[email protected]>

Appending ${TMPDIR} to ${D} doesn't make any sense, because both are absolute paths. And additionally, the code fails:

rmdir: failed to remove '/usr/src/oe/tmp-musl/work/core2-64-oe-linux-musl/php/7.1.9-r0/image//usr': Directory not empty

---
 meta-oe/recipes-devtools/php/php_7.4.9.bb | 9 ---------
 1 file changed, 9 deletions(-)
meta-oe/recipes-devtools/php/php_7.4.9.bb +0 -9
index abd8b167237..1da56078350 100644
@@ -155,7 +155,6 @@ do_install_prepend_class-target() {
 # fixme
 do_install_append_class-target() {
     install -d ${D}${sysconfdir}/
-    rm -rf ${D}/${TMPDIR}
     rm -rf ${D}/.registry
     rm -rf ${D}/.channels
     rm -rf ${D}/.[a-z]*
@@ -179,14 +178,6 @@ do_install_append_class-target() {
             ${D}${systemd_unitdir}/system/php-fpm.service
     fi
 
-    TMP=`dirname ${D}/${TMPDIR}`
-    while test ${TMP} != ${D}; do
-        if [ -d ${TMP} ]; then
-            rmdir ${TMP}
-        fi
-        TMP=`dirname ${TMP}`;
-    done
-
     if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
         install -d ${D}${sysconfdir}/apache2/modules.d
         install -d ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION}
Signature · 1 line
2.17.1
author
#4 lore raw

PATCH 4/6 tcpdump: Patch for CVE-2020-8037

In reply to akuster

From: viatsk <[email protected]>

---
 ...ping-don-t-allocate-a-too-large-buff.patch | 70 +++++++++++++++++++
 .../recipes-support/tcpdump/tcpdump_4.9.3.bb  |  1 +
 2 files changed, 71 insertions(+)
 create mode 100644 meta-networking/recipes-support/tcpdump/tcpdump/0001-PPP-When-un-escaping-don-t-allocate-a-too-large-buff.patch
meta-networking/recipes-support/tcpdump/tcpdump/0001-PPP-When-un-escaping-don-t-allocate-a-too-large-buff.patch new file +70 -0
new file mode 100644
index 00000000000..9b74e00c5b9
@@ -0,0 +1,70 @@
+From 32027e199368dad9508965aae8cd8de5b6ab5231 Mon Sep 17 00:00:00 2001
+From: Guy Harris <[email protected]>
+Date: Sat, 18 Apr 2020 14:04:59 -0700
+Subject: [PATCH] PPP: When un-escaping, don't allocate a too-large buffer.
+
+The buffer should be big enough to hold the captured data, but it
+doesn't need to be big enough to hold the entire on-the-network packet,
+if we haven't captured all of it.
+
+(backported from commit e4add0b010ed6f2180dcb05a13026242ed935334)
+
+Upstream-Status: Backport
+Signed-off-by: Stacy Gaikovaia <[email protected]>
+
+---
+ print-ppp.c | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/print-ppp.c b/print-ppp.c
+index 89176172..33fb0341 100644
+--- a/print-ppp.c
++++ b/print-ppp.c
+@@ -1367,19 +1367,29 @@ trunc:
+ 	return 0;
+ }
+ 
++/*
++ * Un-escape RFC 1662 PPP in HDLC-like framing, with octet escapes.
++ * The length argument is the on-the-wire length, not the captured
++ * length; we can only un-escape the captured part.
++ */
+ static void
+ ppp_hdlc(netdissect_options *ndo,
+          const u_char *p, int length)
+ {
++	u_int caplen = ndo->ndo_snapend - p;
+ 	u_char *b, *t, c;
+ 	const u_char *s;
+-	int i, proto;
++	u_int i;
++	int proto;
+ 	const void *se;
+ 
++	if (caplen == 0)
++		return;
++
+         if (length <= 0)
+                 return;
+ 
+-	b = (u_char *)malloc(length);
++	b = (u_char *)malloc(caplen);
+ 	if (b == NULL)
+ 		return;
+ 
+@@ -1388,10 +1398,10 @@ ppp_hdlc(netdissect_options *ndo,
+ 	 * Do this so that we dont overwrite the original packet
+ 	 * contents.
+ 	 */
+-	for (s = p, t = b, i = length; i > 0 && ND_TTEST(*s); i--) {
++	for (s = p, t = b, i = caplen; i != 0; i--) {
+ 		c = *s++;
+ 		if (c == 0x7d) {
+-			if (i <= 1 || !ND_TTEST(*s))
++			if (i <= 1)
+ 				break;
+ 			i--;
+ 			c = *s++ ^ 0x20;
+-- 
+2.17.1
+
meta-networking/recipes-support/tcpdump/tcpdump_4.9.3.bb +1 -0
index 94543dd1dac..8f7bd59f185 100644
@@ -17,6 +17,7 @@ SRC_URI = " \
     file://avoid-absolute-path-when-searching-for-libdlpi.patch \
     file://add-ptest.patch \
     file://run-ptest \
+    file://0001-PPP-When-un-escaping-don-t-allocate-a-too-large-buff.patch \
 "
 
 SRC_URI[md5sum] = "a4ead41d371f91aa0a2287f589958bae"
Signature · 1 line
2.17.1
author
#5 lore raw

PATCH 5/6 dlt-daemon: add upstream patch to fix CVE-2020-29394

In reply to akuster

From: Gianfranco <[email protected]>

More information on: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976228

| A buffer overflow in the dlt_filter_load function in dlt_common.c in
| dlt-daemon 2.8.5 (GENIVI Diagnostic Log and Trace) allows arbitrary
| code execution because fscanf is misused (no limit on the number of
| characters to be read in a format argument).
---
 .../dlt-daemon/dlt-daemon/275.patch           | 38 +++++++++++++++++++
 .../dlt-daemon/dlt-daemon_2.18.5.bb           |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 meta-oe/recipes-extended/dlt-daemon/dlt-daemon/275.patch
meta-oe/recipes-extended/dlt-daemon/dlt-daemon/275.patch new file +38 -0
new file mode 100644
index 00000000000..75065eb0549
@@ -0,0 +1,38 @@
+Upstream-status: Backport
+CVE: CVE-2020-29394
+From 7f5cd5404a03fa330e192084f6bdafb2dc9bdcb7 Mon Sep 17 00:00:00 2001
+From: GwanYeong Kim <[email protected]>
+Date: Sat, 28 Nov 2020 12:24:46 +0900
+Subject: [PATCH] dlt_common: Fix buffer overflow in dlt_filter_load
+
+A buffer overflow in the dlt_filter_load function in dlt_common.c in dlt-daemon allows arbitrary code execution via an unsafe usage of fscanf, because it does not limit the number of characters to be read in a format argument.
+
+Fixed: #274
+
+Signed-off-by: GwanYeong Kim <[email protected]>
+---
+ src/shared/dlt_common.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
+index 254f4ce4..d15b1cec 100644
+--- a/src/shared/dlt_common.c
++++ b/src/shared/dlt_common.c
+@@ -404,7 +404,7 @@ DltReturnValue dlt_filter_load(DltFilter *filter, const char *filename, int verb
+     while (!feof(handle)) {
+         str1[0] = 0;
+ 
+-        if (fscanf(handle, "%s", str1) != 1)
++        if (fscanf(handle, "%254s", str1) != 1)
+             break;
+ 
+         if (str1[0] == 0)
+@@ -419,7 +419,7 @@ DltReturnValue dlt_filter_load(DltFilter *filter, const char *filename, int verb
+ 
+         str1[0] = 0;
+ 
+-        if (fscanf(handle, "%s", str1) != 1)
++        if (fscanf(handle, "%254s", str1) != 1)
+             break;
+ 
+         if (str1[0] == 0)
meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.5.bb +1 -0
index f3fcee4d201..5066e76d348 100644
@@ -19,6 +19,7 @@ SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=https \
     file://0004-Modify-systemd-config-directory.patch \
     file://241.patch \
     file://245.patch \
+    file://275.patch \
 "
 SRCREV = "f1ac087c766827b1d0ed9c3a814b3cc052e948f2"
 
Signature · 1 line
2.17.1
author
#6 lore raw

PATCH 6/6 pcsc-lite: provide pcsc-lite-lib-native explicitly for native build

In reply to akuster

From: Roland Hieber <[email protected]>

Commits e2180b00b3b8fcf776c3 and 8edd760e66b48e411d2a added support for native builds for the opensc and pcsc-lite recipes, but building opensc-native fails after commit 40b3a5123120da0e4586 (2019-12-04, "opensc: fix RDEPENDS in pcsc PACKAGECONFIG") with:

ERROR: Required build target 'opensc-native' has no buildable providers. Missing or unbuildable dependency chain was: ['opensc-native', 'pcsc-lite-lib-native']

The commit in question is correct for target builds, but native builds don't have packages, therefore there is no pcsc-lite-lib-native package to depend on – the -lib part is also provided in pcsc-lite-native.

Ideally we would fix this in the opensc recipe. However, using syntax like "PACKAGECONFIG_class-native[pcsc]" in the opensc recipe is apparently not possible to overwrite the dependency for a native build, and using RDEPENDS_remove has no effect either – apparently dependencies from PACKAGECONFIG are added after RDEPENDS_remove is evaluated. Therefore let pcsc-lite provide the missing package name for native builds, even if fixing this unrelated package is not the most elegant solution.

Fixes 40b3a5123120da0e4586 (2019-12-04, "opensc: fix RDEPENDS in pcsc PACKAGECONFIG")
---
 meta-oe/recipes-support/pcsc-lite/pcsc-lite_1.9.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-support/pcsc-lite/pcsc-lite_1.9.0.bb +1 -0
index 6f38d65e05d..c1b793960f5 100644
@@ -36,6 +36,7 @@ PACKAGES = "${PN} ${PN}-dbg ${PN}-dev ${PN}-lib ${PN}-doc ${PN}-spy ${PN}-spy-de
 
 RRECOMMENDS_${PN} = "ccid"
 RRECOMMENDS_${PN}_class-native = ""
+RPROVIDES_${PN}_class-native += "pcsc-lite-lib-native"
 
 FILES_${PN} = "${sbindir}/pcscd"
 FILES_${PN}-lib = "${libdir}/libpcsclite*${SOLIBS}"
Signature · 1 line
2.17.1