summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorGeoffrey GIRY <geoffrey.giry@smile.fr>2023-03-28 12:23:49 +0200
committerSteve Sakoman <steve@sakoman.com>2023-04-14 05:44:12 -1000
commitd8057ae9aa73616d2383e5d10d2125d1912b0a13 (patch)
tree6ef95d877a3a68197b2c5bf71d621c7e68b864cb /meta/classes
parent5150ad7fcb320964dc215866a1943d4732b49e98 (diff)
downloadpoky-d8057ae9aa73616d2383e5d10d2125d1912b0a13.tar.gz
cve-check: Fix false negative version issue
NVD DB store version and update in the same value, separated by '_'. The proposed patch check if the version from NVD DB contains a "_", ie 9.2.0_p1 is convert to 9.2.0p1 before version comparison. [YOCTO #14127] Reviewed-by: Yoann CONGAL <yoann.congal@smile.fr> (From OE-Core rev: eb439b1283b60e6665694ff28c89fbd633eda6b0) Signed-off-by: Geoffrey GIRY <geoffrey.giry@smile.fr> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 7d00f6ec578084a0a0e5caf36241d53036d996c4) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cve-check.bbclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index 87a59d5c6d..05b9cb47dc 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -253,7 +253,7 @@ def check_cves(d, patched_cves):
253 """ 253 """
254 Connect to the NVD database and find unpatched cves. 254 Connect to the NVD database and find unpatched cves.
255 """ 255 """
256 from oe.cve_check import Version 256 from oe.cve_check import Version, convert_cve_version
257 257
258 pn = d.getVar("PN") 258 pn = d.getVar("PN")
259 real_pv = d.getVar("PV") 259 real_pv = d.getVar("PV")
@@ -317,6 +317,9 @@ def check_cves(d, patched_cves):
317 if cve in cve_whitelist: 317 if cve in cve_whitelist:
318 ignored = True 318 ignored = True
319 319
320 version_start = convert_cve_version(version_start)
321 version_end = convert_cve_version(version_end)
322
320 if (operator_start == '=' and pv == version_start) or version_start == '-': 323 if (operator_start == '=' and pv == version_start) or version_start == '-':
321 vulnerable = True 324 vulnerable = True
322 else: 325 else: