summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2024-11-24 21:13:42 +0100
committerSteve Sakoman <steve@sakoman.com>2025-02-12 06:29:33 -0800
commit2d4aee3d97bdcdd48ccb2a4fd34399e13cca9e22 (patch)
tree10be5133250806cffe02a112896f2b5022ed1ab0 /meta/classes
parenta1b7ded85a1e4791038ff69115635c01f36b4a74 (diff)
downloadpoky-2d4aee3d97bdcdd48ccb2a4fd34399e13cca9e22.tar.gz
cve-check: fix cvesInRecord
Currently flag cvesInRecord is set to false if all CVEs are ignored or patched. This is inconsistent as it shows false if a CVE was fixed via patch and true if this CVE was fixed by upgrade. In both cases the CVE is valid and was fixed. As I understand this flag, it should say if any CVE exists for particular component's product (regardless of how this CVE is handled) and can be used to validate if a product is correctly set. Note that skipping ignored CVEs may make sense in some cases, as ignored may mean that NVD DB is wrong, but in many cases it is ignored for other reasons. Further patch can be done to evaluate ignore subtype but that would be against my understanding of this flag as described above. (From OE-Core rev: 0fb2bfb8d6c77009385d7deca2e758bdee5c9b07) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c5d499693672ec9619392011b765941cf94aa319) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cve-check.bbclass11
1 files changed, 6 insertions, 5 deletions
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index 33d41b912d..6e10dd915a 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -343,17 +343,18 @@ def check_cves(d, cve_data):
343 for cverow in cve_cursor: 343 for cverow in cve_cursor:
344 cve = cverow[0] 344 cve = cverow[0]
345 345
346 # Write status once only for each product
347 if not cves_in_product:
348 cves_status.append([product, True])
349 cves_in_product = True
350 cves_in_recipe = True
351
346 if cve_is_ignored(d, cve_data, cve): 352 if cve_is_ignored(d, cve_data, cve):
347 bb.note("%s-%s ignores %s" % (product, pv, cve)) 353 bb.note("%s-%s ignores %s" % (product, pv, cve))
348 continue 354 continue
349 elif cve_is_patched(d, cve_data, cve): 355 elif cve_is_patched(d, cve_data, cve):
350 bb.note("%s has been patched" % (cve)) 356 bb.note("%s has been patched" % (cve))
351 continue 357 continue
352 # Write status once only for each product
353 if not cves_in_product:
354 cves_status.append([product, True])
355 cves_in_product = True
356 cves_in_recipe = True
357 358
358 vulnerable = False 359 vulnerable = False
359 ignored = False 360 ignored = False