]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
cve_check: skip remote patches that haven't been fetched when searching for CVE tags
authorRoss Burton <ross.burton@arm.com>
Wed, 27 Apr 2022 11:43:39 +0000 (12:43 +0100)
committerSteve Sakoman <steve@sakoman.com>
Wed, 10 Aug 2022 15:04:10 +0000 (05:04 -1000)
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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit cefc8741438c91f74264da6b59dece2e31f9e5a5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/lib/oe/cve_check.py

index a4b831831b100e960a5a37b308bdc6f130095fbd..30fdc3e3ddcfd80d6261d42a59a7a16112986cd1 100644 (file)
@@ -114,9 +114,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)