diff options
| author | Geoffrey GIRY <geoffrey.giry@smile.fr> | 2023-03-28 12:23:49 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-04-11 11:31:52 +0100 |
| commit | 8064466b45668bb188bd16a6a49f7f085672749d (patch) | |
| tree | e39f022d89a8d1488a1b29cfa52c36db606e37f5 /meta/classes | |
| parent | fd78b2c6ac8a952154c1eebd412d271af6ec6805 (diff) | |
| download | poky-8064466b45668bb188bd16a6a49f7f085672749d.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: f331c80df6c447d3073ebe3f00102c78ced242f3)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/cve-check.bbclass | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass index b9c0bfd6d8..3c922b27af 100644 --- a/meta/classes/cve-check.bbclass +++ b/meta/classes/cve-check.bbclass | |||
| @@ -254,7 +254,7 @@ def check_cves(d, patched_cves): | |||
| 254 | """ | 254 | """ |
| 255 | Connect to the NVD database and find unpatched cves. | 255 | Connect to the NVD database and find unpatched cves. |
| 256 | """ | 256 | """ |
| 257 | from oe.cve_check import Version | 257 | from oe.cve_check import Version, convert_cve_version |
| 258 | 258 | ||
| 259 | pn = d.getVar("PN") | 259 | pn = d.getVar("PN") |
| 260 | real_pv = d.getVar("PV") | 260 | real_pv = d.getVar("PV") |
| @@ -318,6 +318,9 @@ def check_cves(d, patched_cves): | |||
| 318 | if cve in cve_ignore: | 318 | if cve in cve_ignore: |
| 319 | ignored = True | 319 | ignored = True |
| 320 | 320 | ||
| 321 | version_start = convert_cve_version(version_start) | ||
| 322 | version_end = convert_cve_version(version_end) | ||
| 323 | |||
| 321 | if (operator_start == '=' and pv == version_start) or version_start == '-': | 324 | if (operator_start == '=' and pv == version_start) or version_start == '-': |
| 322 | vulnerable = True | 325 | vulnerable = True |
| 323 | else: | 326 | else: |
