]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
lib: spdx30_tasks: Handle patched CVEs
authorJoshua Watt <JPEWhacker@gmail.com>
Thu, 6 Mar 2025 21:20:07 +0000 (14:20 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 8 Mar 2025 18:08:01 +0000 (18:08 +0000)
The code to iterate over patched CVEs (e.g. those patched by a .patch
file in SRC_URI) was accidentally omitted when writing the SPDX 3
handling. Add it in now

[YOCTO #15789]

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/spdx30_tasks.py

index e3e5dbc742764585df855441f3cbc790971fde74..e20bb0c86f3b0ed537499b1dc1149873f1c9fa9b 100644 (file)
@@ -498,6 +498,16 @@ def create_spdx(d):
     # Add CVEs
     cve_by_status = {}
     if include_vex != "none":
+        for cve in oe.cve_check.get_patched_cves(d):
+            spdx_cve = build_objset.new_cve_vuln(cve)
+            build_objset.set_element_alias(spdx_cve)
+
+            cve_by_status.setdefault("Patched", {})[cve] = (
+                spdx_cve,
+                "patched",
+                "",
+            )
+
         for cve in d.getVarFlags("CVE_STATUS") or {}:
             decoded_status = oe.cve_check.decode_cve_status(d, cve)