All of lore.kernel.org
 help / color / mirror / Atom feed
* [master] [PATCH] cve-check: Add provision to exclude classes
@ 2024-03-03 17:53 dnagodra
  2024-03-13 19:30 ` Dhairya Nagodra -X (dnagodra - E-INFO CHIPS INC at Cisco)
  2024-03-15 16:08 ` [OE-core] " Ross Burton
  0 siblings, 2 replies; 6+ messages in thread
From: dnagodra @ 2024-03-03 17:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: xe-linux-external, Dhairya Nagodra

From: Dhairya Nagodra <dnagodra@cisco.com>

- There are times when exluding a package that inherits a particular
  class/classes may be desired.
- This provides the framework for that via the variable:
  CVE_CHECK_CLASS_EXCLUDELIST

Signed-off-by: Dhairya Nagodra <dnagodra@cisco.com>
---
 meta/classes/cve-check.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index 56ba8bceef..6d459642fe 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -100,6 +100,8 @@ CVE_CHECK_LAYER_EXCLUDELIST ??= ""
 # Layers to be included
 CVE_CHECK_LAYER_INCLUDELIST ??= ""
 
+# Classes to be excluded
+CVE_CHECK_CLASS_EXCLUDELIST ??= ""
 
 # set to "alphabetical" for version using single alphabetical character as increment release
 CVE_VERSION_SUFFIX ??= ""
@@ -466,6 +468,7 @@ def cve_write_data_text(d, patched, unpatched, ignored, cve_data):
 
     include_layers = d.getVar("CVE_CHECK_LAYER_INCLUDELIST").split()
     exclude_layers = d.getVar("CVE_CHECK_LAYER_EXCLUDELIST").split()
+    exclude_classes = d.getVar("CVE_CHECK_CLASS_EXCLUDELIST").split()
 
     report_all = d.getVar("CVE_CHECK_REPORT_PATCHED") == "1"
 
@@ -475,6 +478,10 @@ def cve_write_data_text(d, patched, unpatched, ignored, cve_data):
     if include_layers and layer not in include_layers:
         return
 
+    for excluded in exclude_classes:
+        if bb.data.inherits_class(excluded, d):
+            return
+
     # Early exit, the text format does not report packages without CVEs
     if not patched+unpatched+ignored:
         return
@@ -581,6 +588,7 @@ def cve_write_data_json(d, patched, unpatched, ignored, cve_data, cve_status):
 
     include_layers = d.getVar("CVE_CHECK_LAYER_INCLUDELIST").split()
     exclude_layers = d.getVar("CVE_CHECK_LAYER_EXCLUDELIST").split()
+    exclude_classes = d.getVar("CVE_CHECK_CLASS_EXCLUDELIST").split()
 
     report_all = d.getVar("CVE_CHECK_REPORT_PATCHED") == "1"
 
@@ -590,6 +598,10 @@ def cve_write_data_json(d, patched, unpatched, ignored, cve_data, cve_status):
     if include_layers and layer not in include_layers:
         return
 
+    for excluded in exclude_classes:
+        if bb.data.inherits_class(excluded, d):
+            return
+
     unpatched_cves = []
 
     product_data = []
-- 
2.35.6



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-18 17:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-03 17:53 [master] [PATCH] cve-check: Add provision to exclude classes dnagodra
2024-03-13 19:30 ` Dhairya Nagodra -X (dnagodra - E-INFO CHIPS INC at Cisco)
2024-03-15 16:08 ` [OE-core] " Ross Burton
2024-03-15 19:52   ` Dhairya Nagodra -X (dnagodra - E-INFO CHIPS INC at Cisco)
2024-03-18  6:31     ` Mikko Rapeli
2024-03-18 17:02     ` Ross Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.