Skip to contentSkip to conversation

Patch review

PATCH In review Steve Sakoman 3 participants 8 messages May 25, 2022 – May 26, 2022

lore
Share & tools
lore
#0 lore raw

cover Patch review

Please review this set of patches for dunfell and have comments back by end of day Friday.

Passed a-full on autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3702
The following changes since commit 665f981fccbb09d51349c4bd4cfe4ca91001e3bd:

cve-check: Fix report generation (2022-05-18 05:41:41 -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

Alexander Kanavin (1):
mobile-broadband-provider-info: upgrade 20220315 -> 20220511

Hitendra Prajapati (1):
pcre2: CVE-2022-1586 Out-of-bounds read

Minjae Kim (1):
libdrm: add libdrm-{nouveau,radeon,intel} to RPROVIDES

Ross Burton (1):
oeqa/selftest/cve_check: add tests for recipe and image reports

 meta/lib/oeqa/selftest/cases/cve_check.py     | 77 ++++++++++++++++++-
 .../mobile-broadband-provider-info_git.bb     |  4 +-
 meta/recipes-graphics/drm/libdrm_2.4.101.bb   |  6 ++
 .../libpcre/libpcre2/CVE-2022-1586.patch      | 59 ++++++++++++++
 .../recipes-support/libpcre/libpcre2_10.34.bb |  1 +
 5 files changed, 144 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-support/libpcre/libpcre2/CVE-2022-1586.patch
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/4 pcre2: CVE-2022-1586 Out-of-bounds read

From: Hitendra Prajapati <[email protected]>

Source: https://github.com/PCRE2Project/pcre2
MR: 118027
Type: Security Fix
Disposition: Backport from https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a
ChangeID: e9b448d96a7e58b34b2c4069757a6f3ca0917713
Description:

CVE-2022-1586: pcre2: Out-of-bounds read in compile_xclass_matchingpath in pcre2_jit_compile.c.

---
 .../libpcre/libpcre2/CVE-2022-1586.patch      | 59 +++++++++++++++++++
 .../recipes-support/libpcre/libpcre2_10.34.bb |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta/recipes-support/libpcre/libpcre2/CVE-2022-1586.patch
meta/recipes-support/libpcre/libpcre2/CVE-2022-1586.patch new file +59 -0
new file mode 100644
index 0000000000..fbbbc9ca77
@@ -0,0 +1,59 @@
+From 233c4248550d0c1d9bfee42198d5ee0855b7d413 Mon Sep 17 00:00:00 2001
+From: Hitendra Prajapati <[email protected]>
+Date: Mon, 23 May 2022 13:52:39 +0530
+Subject: [PATCH] CVE-2022-1586
+
+Upstream-Status: Backport from https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a
+
+Signed-off-by: Hitendra Prajapati <[email protected]>
+---
+ ChangeLog               | 3 +++
+ src/pcre2_jit_compile.c | 2 +-
+ src/pcre2_jit_test.c    | 4 ++++
+ 3 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 0926c29..b5d72dc 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,6 +1,9 @@
+ Change Log for PCRE2
+ --------------------
+ 
++23. Fixed a unicode properrty matching issue in JIT. The character was not
++fully read in caseless matching.
++
+ 
+ Version 10.34 21-November-2019
+ ------------------------------
+diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
+index f564127..5d43865 100644
+--- a/src/pcre2_jit_compile.c
++++ b/src/pcre2_jit_compile.c
+@@ -7119,7 +7119,7 @@ while (*cc != XCL_END)
+     {
+     SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
+     cc++;
+-    if (*cc == PT_CLIST)
++    if (*cc == PT_CLIST && *cc == XCL_PROP)
+       {
+       other_cases = PRIV(ucd_caseless_sets) + cc[1];
+       while (*other_cases != NOTACHAR)
+diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c
+index a9b3880..9df87fd 100644
+--- a/src/pcre2_jit_test.c
++++ b/src/pcre2_jit_test.c
+@@ -408,6 +408,10 @@ static struct regression_test_case regression_test_cases[] = {
+ 	{ MUP, A, 0, 0 | F_PROPERTY, "[\xc3\xa2-\xc3\xa6\xc3\x81-\xc3\x84\xe2\x80\xa8-\xe2\x80\xa9\xe6\x92\xad\\p{Zs}]{2,}", "\xe2\x80\xa7\xe2\x80\xa9\xe6\x92\xad \xe6\x92\xae" },
+ 	{ MUP, A, 0, 0 | F_PROPERTY, "[\\P{L&}]{2}[^\xc2\x85-\xc2\x89\\p{Ll}\\p{Lu}]{2}", "\xc3\xa9\xe6\x92\xad.a\xe6\x92\xad|\xc2\x8a#" },
+ 	{ PCRE2_UCP, 0, 0, 0 | F_PROPERTY, "[a-b\\s]{2,5}[^a]", "AB  baaa" },
++	{ MUP, 0, 0, 0 | F_NOMATCH, "[^\\p{Hangul}\\p{Z}]", " " },
++	{ MUP, 0, 0, 0, "[\\p{Lu}\\P{Latin}]+", "c\xEA\xA4\xAE,A,b" },
++	{ MUP, 0, 0, 0, "[\\x{a92e}\\p{Lu}\\P{Latin}]+", "c\xEA\xA4\xAE,A,b" },
++	{ CMUP, 0, 0, 0, "[^S]\\B", "\xe2\x80\x8a" },
+ 
+ 	/* Possible empty brackets. */
+ 	{ MU, A, 0, 0, "(?:|ab||bc|a)+d", "abcxabcabd" },
+-- 
+2.25.1
+
meta/recipes-support/libpcre/libpcre2_10.34.bb +1 -0
index f2c36944d8..213b946a54 100644
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=b1588d3bb4cb0e1f5a597d908f8c5b37"
 
 SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/pcre2-${PV}.tar.bz2 \
            file://pcre-cross.patch \
+           file://CVE-2022-1586.patch \
 "
 
 SRC_URI[md5sum] = "d280b62ded13f9ccf2fac16ee5286366"
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/4 mobile-broadband-provider-info: upgrade 20220315 -> 20220511

In reply to Steve Sakoman

From: Alexander Kanavin <[email protected]>

(cherry picked from commit f14c8094e7a049ac1b04c45b76855d0503559932)
---
 .../mobile-broadband-provider-info_git.bb                     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb +2 -2
index 781b9216c5..e6f216e5cb 100644
@@ -5,8 +5,8 @@ SECTION = "network"
 LICENSE = "PD"
 LIC_FILES_CHKSUM = "file://COPYING;md5=87964579b2a8ece4bc6744d2dc9a8b04"
 
-SRCREV = "4cbb44a9fe26aa6f0b28beb79f9488b37c097b5e"
-PV = "20220315"
+SRCREV = "3d5c8d0f7e0264768a2c000d0fd4b4d4a991e041"
+PV = "20220511"
 PE = "1"
 
 SRC_URI = "git://gitlab.gnome.org/GNOME/mobile-broadband-provider-info.git;protocol=https;branch=main"
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/4 oeqa/selftest/cve_check: add tests for recipe and image reports

In reply to Steve Sakoman

From: Ross Burton <[email protected]>

Add a test to verify that the JSON reports are generated correctly for both single recipe builds and image builds.

More tests are needed, but this is better than nothing.

(cherry picked from commit df0f35555b09c4bc75470eb45ec9c74e6587d460)
---
 meta/lib/oeqa/selftest/cases/cve_check.py | 77 ++++++++++++++++++++++-
 1 file changed, 76 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/cve_check.py +76 -1
index d1947baffc..2f26f606d7 100644
@@ -1,9 +1,13 @@
-from oe.cve_check import Version
+import json
+import os
 from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake, get_bb_vars
 
 class CVECheck(OESelftestTestCase):
 
     def test_version_compare(self):
+        from oe.cve_check import Version
+
         result = Version("100") > Version("99")
         self.assertTrue( result, msg="Failed to compare version '100' > '99'")
         result = Version("2.3.1") > Version("2.2.3")
@@ -42,3 +46,74 @@ class CVECheck(OESelftestTestCase):
         self.assertTrue( result ,msg="Failed to compare version with suffix '1.0p2' > '1.0p1'")
         result = Version("1.0_patch2","patch") < Version("1.0_patch3","patch")
         self.assertTrue( result ,msg="Failed to compare version with suffix '1.0_patch2' < '1.0_patch3'")
+
+
+    def test_recipe_report_json(self):
+        config = """
+INHERIT += "cve-check"
+CVE_CHECK_FORMAT_JSON = "1"
+"""
+        self.write_config(config)
+
+        vars = get_bb_vars(["CVE_CHECK_SUMMARY_DIR", "CVE_CHECK_SUMMARY_FILE_NAME_JSON"])
+        summary_json = os.path.join(vars["CVE_CHECK_SUMMARY_DIR"], vars["CVE_CHECK_SUMMARY_FILE_NAME_JSON"])
+        recipe_json = os.path.join(vars["CVE_CHECK_SUMMARY_DIR"], "m4-native_cve.json")
+
+        try:
+            os.remove(summary_json)
+            os.remove(recipe_json)
+        except FileNotFoundError:
+            pass
+
+        bitbake("m4-native -c cve_check")
+
+        def check_m4_json(filename):
+            with open(filename) as f:
+                report = json.load(f)
+            self.assertEqual(report["version"], "1")
+            self.assertEqual(len(report["package"]), 1)
+            package = report["package"][0]
+            self.assertEqual(package["name"], "m4-native")
+            found_cves = { issue["id"]: issue["status"] for issue in package["issue"]}
+            self.assertIn("CVE-2008-1687", found_cves)
+            self.assertEqual(found_cves["CVE-2008-1687"], "Patched")
+
+        self.assertExists(summary_json)
+        check_m4_json(summary_json)
+        self.assertExists(recipe_json)
+        check_m4_json(recipe_json)
+
+
+    def test_image_json(self):
+        config = """
+INHERIT += "cve-check"
+CVE_CHECK_FORMAT_JSON = "1"
+"""
+        self.write_config(config)
+
+        vars = get_bb_vars(["CVE_CHECK_DIR", "CVE_CHECK_SUMMARY_DIR", "CVE_CHECK_SUMMARY_FILE_NAME_JSON"])
+        report_json = os.path.join(vars["CVE_CHECK_SUMMARY_DIR"], vars["CVE_CHECK_SUMMARY_FILE_NAME_JSON"])
+        print(report_json)
+        try:
+            os.remove(report_json)
+        except FileNotFoundError:
+            pass
+
+        bitbake("core-image-minimal-initramfs")
+        self.assertExists(report_json)
+
+        # Check that the summary report lists at least one package
+        with open(report_json) as f:
+            report = json.load(f)
+        self.assertEqual(report["version"], "1")
+        self.assertGreater(len(report["package"]), 1)
+
+        # Check that a random recipe wrote a recipe report to deploy/cve/
+        recipename = report["package"][0]["name"]
+        recipe_report = os.path.join(vars["CVE_CHECK_DIR"], recipename + "_cve.json")
+        self.assertExists(recipe_report)
+        with open(recipe_report) as f:
+            report = json.load(f)
+        self.assertEqual(report["version"], "1")
+        self.assertEqual(len(report["package"]), 1)
+        self.assertEqual(report["package"][0]["name"], recipename)
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/4 libdrm: add libdrm-{nouveau,radeon,intel} to RPROVIDES

In reply to Steve Sakoman

From: Minjae Kim <[email protected]>

The libdrm-{nouveau,radeon,intel} are generated by libdrm recipe. To use these libraries as a dependency in another component, It should be explicitly added as RPROVIDES.

---
 meta/recipes-graphics/drm/libdrm_2.4.101.bb | 6 ++++++
 1 file changed, 6 insertions(+)
meta/recipes-graphics/drm/libdrm_2.4.101.bb +6 -0
index 8ec566faa9..4f3e767af0 100644
@@ -57,3 +57,9 @@ FILES_${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.* ${datadir}/${PN}/amdgpu.ids"
 FILES_${PN}-etnaviv = "${libdir}/libdrm_etnaviv.so.*"
 
 BBCLASSEXTEND = "native nativesdk"
+
+RPROVIDES_${PN} += " \
+    libdrm-nouveau \
+    libdrm-radeon \
+    libdrm-intel \
+"
Signature · 1 line
2.25.1
#5 lore raw

Re: [OE-core][dunfell 4/4] libdrm: add libdrm-{nouveau,radeon,intel} to RPROVIDES

Why should ${PN} rprovide these when they are packaged in separate packages as ${PN}-nouveau ${PN}-intel ${PN}-radeon?

Quoted 43 lines · Steve Sakoman

From: Minjae Kim <[email protected]>

The libdrm-{nouveau,radeon,intel} are generated by libdrm recipe. To use these libraries as a dependency in another component, It should be explicitly added as RPROVIDES.

---
 meta/recipes-graphics/drm/libdrm_2.4.101.bb | 6 ++++++
 1 file changed, 6 insertions(+)
meta/recipes-graphics/drm/libdrm_2.4.101.bb +0 -0
index 8ec566faa9..4f3e767af0 100644
@@ -57,3 +57,9 @@ FILES_${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.*

${datadir}/${PN}/amdgpu.ids"
FILES_${PN}-etnaviv = "${libdir}/libdrm_etnaviv.so.*"

BBCLASSEXTEND = "native nativesdk"

meta/recipes-graphics/drm/libdrm_2.4.101.bb +6 -1
+
+RPROVIDES_${PN} += " \
+    libdrm-nouveau \
+    libdrm-radeon \
+    libdrm-intel \
+"
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#166150):
https://lists.openembedded.org/g/openembedded-core/message/166150
Mute This Topic: https://lists.openembedded.org/mt/91334283/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#6 lore raw

Re: [OE-core][dunfell 4/4] libdrm: add libdrm-{nouveau,radeon,intel} to RPROVIDES

Quoted 2 lines · Martin Jansa

Why should ${PN} rprovide these when they are packaged in separate packages as ${PN}-nouveau ${PN}-intel ${PN}-radeon?

Good question! Sorry I didn't catch this earlier. I'll drop this patch from the pull request. Thanks for reviewing.

Steve

Quoted 40 lines · Steve Sakoman
Quoted 39 lines

From: Minjae Kim <[email protected]>

The libdrm-{nouveau,radeon,intel} are generated by libdrm recipe. To use these libraries as a dependency in another component, It should be explicitly added as RPROVIDES.

---
 meta/recipes-graphics/drm/libdrm_2.4.101.bb | 6 ++++++
 1 file changed, 6 insertions(+)
meta/recipes-graphics/drm/libdrm_2.4.101.bb +6 -1
index 8ec566faa9..4f3e767af0 100644
@@ -57,3 +57,9 @@ FILES_${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.* ${datadir}/${PN}/amdgpu.ids"
 FILES_${PN}-etnaviv = "${libdir}/libdrm_etnaviv.so.*"
 
 BBCLASSEXTEND = "native nativesdk"
+
+RPROVIDES_${PN} += " \
+    libdrm-nouveau \
+    libdrm-radeon \
+    libdrm-intel \
+"
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#166150): https://lists.openembedded.org/g/openembedded-core/message/166150
Mute This Topic: https://lists.openembedded.org/mt/91334283/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#7 lore raw

Re: [dunfell 4/4] libdrm: add libdrm-{nouveau,radeon,intel} to RPROVIDES

In reply to Steve Sakoman

To these packages( ${PN}-nouveau ${PN}-intel ${PN}-radeon) use as rdepends, these packages will not be installed when just libdrm add. So I would like to use these packages directly, I added it as RPROVIDES.
In case of installing packages using DNF from binary feed on the target image,
this change can install packages specified by RDEPENDS at the same time.