cve_check: skip remote patches that haven't been fetched when searching for CVE tags
PATCH 1/1 cve_check: skip remote patches that haven't been fetched when searching for CVE tags
If a remote patch is compressed we need to have run the unpack task for the file to exist locally. Currently cve_check only depends on fetch so instead of erroring out, emit a warning that this file won't be scanned for CVE references.
Typically, remote compressed patches won't contain our custom tags, so this is unlikely to be an issue.
--- meta/lib/oe/cve_check.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/lib/oe/cve_check.py +3 -2
@@ -89,9 +89,10 @@ def get_patched_cves(d): for url in oe.patch.src_patches(d): patch_file = bb.fetch.decodeurl(url)[2] + # Remote compressed patches may not be unpacked, so silently ignore them if not os.path.isfile(patch_file): - bb.error("File Not found: %s" % patch_file) - raise FileNotFoundError + bb.warn("%s does not exist, cannot extract CVE list" % patch_file) + continue # Check patch file name for CVE ID fname_match = cve_file_name_match.search(patch_file)
Signature · 1 line
2.25.1
Quoted 36 lines · Ross Burton
If a remote patch is compressed we need to have run the unpack task for the file to exist locally. Currently
cve_checkonly depends on fetch so instead of erroring out, emit a warning that this file won't be scanned for CVE references.Typically, remote compressed patches won't contain our custom tags, so this is unlikely to be an issue.
Signed-off-by Ross Burton <[email protected]>--- meta/lib/oe/cve_check.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)meta/lib/oe/cve_check.py +1
-0@@ -89,9 +89,10 @@ def get_patched_cves(d): for url in oe.patch.src_patches(d): patch_file = bb.fetch.decodeurl(url)[2] + # Remote compressed patches may not be unpacked, so silentlyignore them
if notos.path.isfile(patch_file):meta/lib/oe/cve_check.py +1
-2- bb.error("File Not found: %s" % patch_file) - raise FileNotFoundError + bb.warn("%s does not exist, cannot extract CVE list" %
patch_file)
+ continue# Check patch file name for CVE ID
fname_match=cve_file_name_match.search(patch_file)
--
2.25.1Tested-by Marta Rybczynska <[email protected]>