Skip to contentSkip to conversation

cve-check: Log if CVE_STATUS set but not reported for component

PATCH New [email protected] 1 participant 1 message Feb 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cve-check: Log if CVE_STATUS set but not reported for component

From: Simone Weiß <[email protected]>

Log if the CVE_STATUS is set for a CVE, but the cve is not reported for a component. This should hopefully help to clean up not needed CVE_STATUS settings.

---
v2: Add this to oe.qa mechanism instead of using bb.warn. This way it will only be executed if one adds it to WARN_QA. Not added there by default, so it should not be bothering unless a explicit check is wanted.

 meta/classes/cve-check.bbclass | 3 +++
 1 file changed, 3 insertions(+)
meta/classes/cve-check.bbclass +3 -0
index 5191d04303..56ba8bceef 100644
@@ -418,6 +418,9 @@ def check_cves(d, patched_cves):
             cves_status.append([product, False])
 
     conn.close()
+    diff_ignore = list(set(cve_ignore) - set(cves_ignored))
+    if diff_ignore:
+        oe.qa.handle_error("cve_status_not_in_db", "Found CVE (%s) with CVE_STATUS set that are not found in database for this component" % " ".join(diff_ignore), d)
 
     if not cves_in_recipe:
         bb.note("No CVE records for products in recipe %s" % (pn))
Signature · 1 line
2.39.2