@@ -141,7 +141,6 @@ python do_generate_vex () {
for cve_id in (d.getVarFlags("CVE_STATUS") or {}):
mapping, detail, description = decode_cve_status(d, cve_id)
if not mapping or not detail:
- bb.warn(f"Skipping {cve_id} — missing or unknown CVE status")
continue
cve_data[cve_id] = {
"abbrev-status": mapping,
@@ -267,13 +267,35 @@ def decode_cve_status_scoped(d, cve):
def decode_cve_status(d, cve):
"""
- Convert CVE_STATUS into status, detail and description.
+ Convert CVE_STATUS into status, detail and description, ignoring
+ entries scoped to a product not in CVE_PRODUCT.
"""
status = decode_cve_status_scoped(d, cve)
if not status:
return ("", "", "")
+ # Unscoped entries keep applying when CVE_PRODUCT is empty.
+ unscoped = status["vendor"] == status["product"] == "*"
+ if not unscoped and not has_cve_product_match(status, d.getVar("CVE_PRODUCT") or ""):
+ return ("", "", "")
return (status["mapping"], status["detail"], status["description"])
+def has_cve_product_match(detailed_status, products):
+ """
+ Check product/vendor match between detailed_status from decode_cve_status and a string of
+ products (like from CVE_PRODUCT)
+ """
+ for product in products.split():
+ vendor = "*"
+ if ":" in product:
+ vendor, product = product.split(":", 1)
+
+ if (vendor == detailed_status["vendor"] or detailed_status["vendor"] == "*") and \
+ (product == detailed_status["product"] or detailed_status["product"] == "*"):
+ return True
+
+ #if no match, return False
+ return False
+
def extend_cve_status(d):
# do this only once in case multiple classes use this
if d.getVar("CVE_STATUS_EXTENDED"):
@@ -470,7 +470,6 @@ def _get_cves_info(d):
for cve_id in (d.getVarFlags("CVE_STATUS") or {}):
mapping, detail, description = oe.cve_check.decode_cve_status(d, cve_id)
if not mapping or not detail:
- bb.warn(f"Skipping {cve_id} — missing or unknown CVE status")
continue
yield cve_id, mapping, detail, description
patched_cves.discard(cve_id)