Skip to contentSkip to conversation

Patch review

PATCH New Steve Sakoman 1 participant 4 messages Jul 13, 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/3905

except for a known autobuilder intermittent issue on oe-selftest-centos:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=14201

which passed on subsequent retest:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/3820

The following changes since commit af25fff399fa623b4fd6efbca21e01ea6b4d1fd7:

qemu: add PACKAGECONFIG for capstone (2022-07-12 04:08:20 -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

Joshua Watt (1):
classes/cve-check: Move get_patches_cves to library

Ross Burton (1):
vim: upgrade to 9.0.0021

Steve Sakoman (1):
openssl: security upgrade 1.1.1p to 1.1.1q

 meta/classes/cve-check.bbclass                | 62 +-------------
 meta/lib/oe/cve_check.py                      | 82 +++++++++++++++++++
 .../{openssl_1.1.1p.bb => openssl_1.1.1q.bb}  |  2 +-
 meta/recipes-support/vim/vim.inc              |  4 +-
 4 files changed, 87 insertions(+), 63 deletions(-)
 rename meta/recipes-connectivity/openssl/{openssl_1.1.1p.bb => openssl_1.1.1q.bb} (98%)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/3 openssl: security upgrade 1.1.1p to 1.1.1q

Fixed AES OCB failure to encrypt some bytes on 32-bit x86 platforms (CVE-2022-2097)

---
 .../openssl/{openssl_1.1.1p.bb => openssl_1.1.1q.bb}            | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-connectivity/openssl/{openssl_1.1.1p.bb => openssl_1.1.1q.bb} (98%)
meta/recipes-connectivity/openssl/openssl_1.1.1q.bb renamed from meta/recipes-connectivity/openssl/openssl_1.1.1p.bb +1 -1
similarity index 98%
rename from meta/recipes-connectivity/openssl/openssl_1.1.1p.bb
rename to meta/recipes-connectivity/openssl/openssl_1.1.1q.bb
index 8916218c33..139b7fe935 100644
@@ -24,7 +24,7 @@ SRC_URI_append_class-nativesdk = " \
            file://environment.d-openssl.sh \
            "
 
-SRC_URI[sha256sum] = "bf61b62aaa66c7c7639942a94de4c9ae8280c08f17d4eac2e44644d9fc8ace6f"
+SRC_URI[sha256sum] = "d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca"
 
 inherit lib_package multilib_header multilib_script ptest
 MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/3 vim: upgrade to 9.0.0021

In reply to Steve Sakoman

From: Ross Burton <[email protected]>

This fixes the following CVEs:
- CVE-2022-2257
- CVE-2022-2264
- CVE-2022-2284
- CVE-2022-2285
- CVE-2022-2286
- CVE-2022-2287

(cherry picked from commit 03c044a81a76b7505b9d5bf0d936dde75b51905e)
---
 meta/recipes-support/vim/vim.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-support/vim/vim.inc +2 -2
index 84c2eed4c8..1893759ae9 100644
@@ -21,8 +21,8 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
            file://racefix.patch \
            "
 
-PV .= ".0005"
-SRCREV = "040674129f3382822eeb7b590380efa5228124a8"
+PV .= ".0021"
+SRCREV = "5e59ea54c0c37c2f84770f068d95280069828774"
 
 # Remove when 8.3 is out
 UPSTREAM_VERSION_UNKNOWN = "1"
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/3 classes/cve-check: Move get_patches_cves to library

In reply to Steve Sakoman

From: Joshua Watt <[email protected]>

Moving the function will allow other classes to capture which CVEs have been patched, in particular SBoM generation.

Also add a function to capture the CPE ID from the CVE Product and Version

(From OE-Core rev: 75d34259a715120be1d023e4fd7b6b4b125f2443)

(cherry picked from commit fa6c07bc1a585f204dbdc28704f61448edb8fdc8)
---
 meta/classes/cve-check.bbclass | 62 +------------------------
 meta/lib/oe/cve_check.py       | 82 ++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+), 60 deletions(-)
meta/classes/cve-check.bbclass +2 -60
index 1688fe2dfe..9eb9a95574 100644
@@ -136,10 +136,11 @@ python do_cve_check () {
     """
     Check recipe for patched and unpatched CVEs
     """
+    from oe.cve_check import get_patched_cves
 
     if os.path.exists(d.getVar("CVE_CHECK_DB_FILE")):
         try:
-            patched_cves = get_patches_cves(d)
+            patched_cves = get_patched_cves(d)
         except FileNotFoundError:
             bb.fatal("Failure in searching patches")
         whitelisted, patched, unpatched, status = check_cves(d, patched_cves)
@@ -247,65 +248,6 @@ ROOTFS_POSTPROCESS_COMMAND_prepend = "${@'cve_check_write_rootfs_manifest; ' if
 do_rootfs[recrdeptask] += "${@'do_cve_check' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}"
 do_populate_sdk[recrdeptask] += "${@'do_cve_check' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}"
 
-def get_patches_cves(d):
-    """
-    Get patches that solve CVEs using the "CVE: " tag.
-    """
-
-    import re
-
-    pn = d.getVar("PN")
-    cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+")
-
-    # Matches the last "CVE-YYYY-ID" in the file name, also if written
-    # in lowercase. Possible to have multiple CVE IDs in a single
-    # file name, but only the last one will be detected from the file name.
-    # However, patch files contents addressing multiple CVE IDs are supported
-    # (cve_match regular expression)
-
-    cve_file_name_match = re.compile(".*([Cc][Vv][Ee]\-\d{4}\-\d+)")
-
-    patched_cves = set()
-    bb.debug(2, "Looking for patches that solves CVEs for %s" % pn)
-    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:
-            cve = fname_match.group(1).upper()
-            patched_cves.add(cve)
-            bb.debug(2, "Found CVE %s from patch file name %s" % (cve, patch_file))
-
-        with open(patch_file, "r", encoding="utf-8") as f:
-            try:
-                patch_text = f.read()
-            except UnicodeDecodeError:
-                bb.debug(1, "Failed to read patch %s using UTF-8 encoding"
-                        " trying with iso8859-1" %  patch_file)
-                f.close()
-                with open(patch_file, "r", encoding="iso8859-1") as f:
-                    patch_text = f.read()
-
-        # Search for one or more "CVE: " lines
-        text_match = False
-        for match in cve_match.finditer(patch_text):
-            # Get only the CVEs without the "CVE: " tag
-            cves = patch_text[match.start()+5:match.end()]
-            for cve in cves.split():
-                bb.debug(2, "Patch %s solves %s" % (patch_file, cve))
-                patched_cves.add(cve)
-                text_match = True
-
-        if not fname_match and not text_match:
-            bb.debug(2, "Patch %s doesn't solve CVEs" % patch_file)
-
-    return patched_cves
-
 def check_cves(d, patched_cves):
     """
     Connect to the NVD database and find unpatched cves.
meta/lib/oe/cve_check.py +82 -0

85 lines not on this page · raw message

Signature · 1 line
2.25.1