Commit Graph

8 Commits

Author SHA1 Message Date
Peter Marko
0b25d55bc0 linux/cve-exclusion: do not shift first_affected
Stop shifting first_affected if backport is indicated. This does not
have effect on generated list, but makes the logic cleaner as it will
not shift it to "first affected on our branch" and also make it behave
like in defaultStatus==affected case.

Cc: daniel.turull@ericsson.com
(From OE-Core rev: dc1ecb69389dd79354084757ba6b9af0781afcc0)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-04-29 09:55:32 +01:00
Peter Marko
df2436ba97 linux/cve-exclusion: correct fixed-version calculation
Current code takes the first version found as "fixed-version".
That is not correct as it is almost always only the oldest backport.
Fix it by unconditionally shift the assigmnet of variable "fixed" so
that we take last instead of first version.

Cc: daniel.turull@ericsson.com
(From OE-Core rev: 68f8e58a249c8adef18e63f0841e8bfea16f354e)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-04-29 09:55:31 +01:00
Daniel Turull
33ca2959f2 linux/generate-cve-exclusions: use data from CVEProject
The old script was relying on linuxkernelcves.com that was archived in
May 2024 when kernel.org became a CNA.

The new script reads CVE json files from the datadir that can be either
from the official kernel.org CNA [1] or CVEProject [2]

[1] https://git.kernel.org/pub/scm/linux/security/vulns.git
[2] https://github.com/CVEProject/cvelistV5

(From OE-Core rev: 12612e8680798bdce39fbb79885e661596dbd53c)

Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-04-17 11:03:22 +01:00
Yuta Hayama
3b9c48837f linux/generate-cve-exclusions: fix mishandling of boundary values
affected_versions in kernel_cves.json does not mean "first affected version
to last affected version" but actually "first affected version to fixed
version". Therefore, the variable names, conditional expressions, and
CVE_STATUS descriptions should be fixed.

For example, when the script was run against v6.1, if affected_versions was
"xxx to 6.1", the output was "cpe-stable-backport: Backported in 6.1", but
this should be "fixed-version: Fixed from version 6.1".

(From OE-Core rev: 2064b2f9b92e2dff45dab633598b5ed37145d0b6)

Signed-off-by: Yuta Hayama <hayama@lineo.co.jp>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-07 14:52:04 +01:00
Yuta Hayama
dd2e4f417c linux/generate-cve-exclusions: print the generated time in UTC
Allow time comparisons to be made regardless of where the script was run.

(From OE-Core rev: 018e74f2ce0b1a4c0614c99bc19f07f787d61123)

Signed-off-by: Yuta Hayama <hayama@lineo.co.jp>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-06 17:52:45 +01:00
Ross Burton
2b0eac4dd6 linux/generate-cve-exclusions: add version check warning
Embed the version that this file was generated for in the include, and
compare it to the version that is being checked.

This should act as a reminder to update the file when the kernel is
upgraded.

(From OE-Core rev: 645066ecec0f52eac0225a144285f44882003856)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-30 09:56:13 +01:00
Ross Burton
a105e7d254 linux/generate-cve-exclusions.py: fix comparison
The backport detection logic didn't handle issues which were backported
to the current version.

(From OE-Core rev: 1c7b01627b47604744f723d5eeedd455df6307e2)

(From OE-Core rev: 568d65ccfb0e44ef3a40951d9da297036e7f345d)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-22 15:13:54 +01:00
Ross Burton
04a4bac6d2 linux-yocto: add script to generate kernel CVE_STATUS entries
Instead of manually looking up new CVEs and determining what point
releases the fixes are incorporated into, add a script to generate the
CVE_STATUS data automatically.

First, note that this is very much an interim solution until the
cve-check class fetches data from www.linuxkernelcves.com directly.

The script should be passed the path to a local clone of the
linuxkernelcves repository[1] and the kernel version number. It will
then write to standard output the CVE_STATUS entries for every known
kernel CVE.

The script should be periodically reran as CVEs are backported and
kernels upgraded frequently.

[1] https://github.com/nluedtke/linux_kernel_cves

(From OE-Core rev: 8cb184f9de9b0ce5f465ea12ba24beafd6673f01)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-09 21:48:11 +01:00