1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

cve-check: encode affected product/vendor in CVE_STATUS

CVE_STATUS contains assesment of a given CVE, but until now it didn't have
include the affected vendor/product. In the case of a global system include,
that CVE_STATUS was visible in all recipes.

This patch allows encoding of affected product/vendor to each CVE_STATUS
assessment, also for groups. We can then filter them later and use only
CVEs that correspond to the recipe.

This is going to be used in meta/conf/distro/include/cve-extra-exclusions.inc
and similar places.

(From OE-Core rev: abca80a716e92fc18d3085aba1a15f4bac72379c)

Signed-off-by: Marta Rybczynska <marta.rybczynska@syslinbit.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Marta Rybczynska
2024-08-14 07:30:35 +02:00
committed by Richard Purdie
parent 326b4303ea
commit bf34db1439
3 changed files with 48 additions and 26 deletions
+12 -12
View File
@@ -324,8 +324,8 @@ def check_cves(d, patched_cves):
# Convert CVE_STATUS into ignored CVEs and check validity
cve_ignore = []
for cve in (d.getVarFlags("CVE_STATUS") or {}):
decoded_status, _, _ = decode_cve_status(d, cve)
if decoded_status == "Ignored":
decoded_status = decode_cve_status(d, cve)
if 'mapping' in decoded_status and decoded_status['mapping'] == "Ignored":
cve_ignore.append(cve)
import sqlite3
@@ -507,11 +507,11 @@ def cve_write_data_text(d, patched, unpatched, ignored, cve_data):
write_string += "PACKAGE VERSION: %s%s\n" % (d.getVar("EXTENDPE"), d.getVar("PV"))
write_string += "CVE: %s\n" % cve
write_string += "CVE STATUS: %s\n" % status
_, detail, description = decode_cve_status(d, cve)
if detail:
write_string += "CVE DETAIL: %s\n" % detail
if description:
write_string += "CVE DESCRIPTION: %s\n" % description
status_details = decode_cve_status(d, cve)
if 'detail' in status_details:
write_string += "CVE DETAIL: %s\n" % status_details['detail']
if 'description' in status_details:
write_string += "CVE DESCRIPTION: %s\n" % status_details['description']
write_string += "CVE SUMMARY: %s\n" % cve_data[cve]["summary"]
write_string += "CVSS v2 BASE SCORE: %s\n" % cve_data[cve]["scorev2"]
write_string += "CVSS v3 BASE SCORE: %s\n" % cve_data[cve]["scorev3"]
@@ -637,11 +637,11 @@ def cve_write_data_json(d, patched, unpatched, ignored, cve_data, cve_status):
"status" : status,
"link": issue_link
}
_, detail, description = decode_cve_status(d, cve)
if detail:
cve_item["detail"] = detail
if description:
cve_item["description"] = description
status_details = decode_cve_status(d, cve)
if 'detail' in status_details:
cve_item["detail"] = status_details['detail']
if 'description' in status_details:
cve_item["description"] = status_details['description']
cve_list.append(cve_item)
package_data["issue"] = cve_list