]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
improve_kernel_cve_report: do not override backported-patch
authorDaniel Turull <daniel.turull@ericsson.com>
Fri, 4 Jul 2025 13:02:54 +0000 (15:02 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 10 Jul 2025 09:46:57 +0000 (10:46 +0100)
If the user has a CVE_STATUS for their own backported patch,
the backport takes priority over upstream vulnerable versions.

Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/improve_kernel_cve_report.py

index 829cc4cd30e34fca23bcfe23a0d53fa0a4051a55..a81aa0ff94343d897464a91c02c1e5cc5666809c 100755 (executable)
@@ -340,6 +340,10 @@ def cve_update(cve_data, cve, entry):
     if cve_data[cve]['status'] == entry['status']:
         return
     if entry['status'] == "Unpatched" and cve_data[cve]['status'] == "Patched":
+        # Backported-patch (e.g. vendor kernel repo with cherry-picked CVE patch)
+        # has priority over unpatch from CNA
+        if cve_data[cve]['detail'] == "backported-patch":
+            return
         logging.warning("CVE entry %s update from Patched to Unpatched from the scan result", cve)
         cve_data[cve] = copy_data(cve_data[cve], entry)
         return