Skip to contentSkip to conversation

cve-check.bbclass: allow skiping non pbn

PATCH Superseded akuster 2 participants 3 messages Feb 14, 2021 – Feb 15, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

akuster

author
#0 lore raw

PATCH 1/1 cve-check.bbclass: allow skiping non pbn

I don't see the point in logging native, nativesdk etc. The bottom line is the BPN has the issue.

Allow folks to filter out those other package name variations via CVE_CHECK_MANIFEST_FILTER

---
 meta/classes/cve-check.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/classes/cve-check.bbclass +9 -0
index 112ee3379d3..0d33d5a530c 100644
@@ -59,6 +59,7 @@ CVE_CHECK_LAYER_EXCLUDELIST ??= ""
 # Layers to be included 
 CVE_CHECK_LAYER_INCLUDELIST ??= ""
 
+CVE_CHECK_MANIFEST_FILTER ??="0"
 
 # set to "alphabetical" for version using single alphabetical character as increament release
 CVE_VERSION_SUFFIX ??= ""
@@ -96,6 +97,13 @@ python do_cve_check () {
     """
 
     if os.path.exists(d.getVar("CVE_CHECK_DB_FILE")):
+        if d.getVar("CVE_CHECK_MANIFEST_FILTER") == "1":
+            # drop native, nativesdk, cross, etc
+            bpn = d.getVar("BPN")
+            pn = d.getVar("PN")
+            if bpn != pn:
+               return
+
         try:
             patched_cves = get_patches_cves(d)
         except FileNotFoundError:
@@ -164,6 +172,7 @@ def get_patches_cves(d):
     import re
 
     pn = d.getVar("PN")
+
     cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+")
 
     # Matches last CVE-1234-211432 in the file name, also if written
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Quoted 2 lines · akuster

I don't see the point in logging native, nativesdk etc. The bottom line is the BPN has the issue.

While I agree to some part and do alot of:

$ cd build/tmp/deploy/cve
$ less $( grep -l Unpatched * | \
egrep -v -- '-native|-nativesdk|-cross-|-crosssdk' )

I do find that fixing build tooling CVEs is a good idea since they downloads stuff from the Internet.

Hence I'm not sure I like this filter. Maybe at least rename CVE_CHECK_MANIFEST_FILTER to CVE_CHECK_FILTER_BUILD_TOOLS which makes this a bit more clear.

Cheers,

-Mikko

Quoted 49 lines

Allow folks to filter out those other package name variations via CVE_CHECK_MANIFEST_FILTER

---
 meta/classes/cve-check.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/classes/cve-check.bbclass +9 -0
index 112ee3379d3..0d33d5a530c 100644
@@ -59,6 +59,7 @@ CVE_CHECK_LAYER_EXCLUDELIST ??= ""
 # Layers to be included 
 CVE_CHECK_LAYER_INCLUDELIST ??= ""
 
+CVE_CHECK_MANIFEST_FILTER ??="0"
 
 # set to "alphabetical" for version using single alphabetical character as increament release
 CVE_VERSION_SUFFIX ??= ""
@@ -96,6 +97,13 @@ python do_cve_check () {
     """
 
     if os.path.exists(d.getVar("CVE_CHECK_DB_FILE")):
+        if d.getVar("CVE_CHECK_MANIFEST_FILTER") == "1":
+            # drop native, nativesdk, cross, etc
+            bpn = d.getVar("BPN")
+            pn = d.getVar("PN")
+            if bpn != pn:
+               return
+
         try:
             patched_cves = get_patches_cves(d)
         except FileNotFoundError:
@@ -164,6 +172,7 @@ def get_patches_cves(d):
     import re
 
     pn = d.getVar("PN")
+
     cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+")
 
     # Matches last CVE-1234-211432 in the file name, also if written
Signature · 1 line
2.25.1
author
#2 lore raw
Quoted 10 lines · On 2/14/21 11:51 PM, [email protected] wrote:

Hi,

Quoted 2 lines · akuster

I don't see the point in logging native, nativesdk etc. The bottom line is the BPN has the issue.

While I agree to some part and do alot of:

$ cd build/tmp/deploy/cve
$ less $( grep -l Unpatched * | \
egrep -v -- '-native|-nativesdk|-cross-|-crosssdk' )

We appear to generate a lot of redundant information.

Quoted 7 lines

I do find that fixing build tooling CVEs is a good idea since they downloads stuff from the Internet.

Hence I'm not sure I like this filter. Maybe at least rename CVE_CHECK_MANIFEST_FILTER to CVE_CHECK_FILTER_BUILD_TOOLS which makes this a bit more clear.

Yeah, I wasn't all the keen on the name either.  Thanks for the input

thanks,
Armin

Quoted 52 lines

Cheers,

-Mikko

Quoted 47 lines

Allow folks to filter out those other package name variations via CVE_CHECK_MANIFEST_FILTER

---
 meta/classes/cve-check.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/classes/cve-check.bbclass +9 -0
index 112ee3379d3..0d33d5a530c 100644
@@ -59,6 +59,7 @@ CVE_CHECK_LAYER_EXCLUDELIST ??= ""
 # Layers to be included 
 CVE_CHECK_LAYER_INCLUDELIST ??= ""
 
+CVE_CHECK_MANIFEST_FILTER ??="0"
 
 # set to "alphabetical" for version using single alphabetical character as increament release
 CVE_VERSION_SUFFIX ??= ""
@@ -96,6 +97,13 @@ python do_cve_check () {
     """
 
     if os.path.exists(d.getVar("CVE_CHECK_DB_FILE")):
+        if d.getVar("CVE_CHECK_MANIFEST_FILTER") == "1":
+            # drop native, nativesdk, cross, etc
+            bpn = d.getVar("BPN")
+            pn = d.getVar("PN")
+            if bpn != pn:
+               return
+
         try:
             patched_cves = get_patches_cves(d)
         except FileNotFoundError:
@@ -164,6 +172,7 @@ def get_patches_cves(d):
     import re
 
     pn = d.getVar("PN")
+
     cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+")
 
     # Matches last CVE-1234-211432 in the file name, also if written
Signature · 1 line
2.25.1