Skip to contentSkip to conversation

vulnerabitilies: add section for kernel CVEs vulnerabilities

PATCH Superseded [email protected] 2 participants 3 messages Oct 28, 2025 – Nov 10, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vulnerabitilies: add section for kernel CVEs vulnerabilities

From: Daniel Turull <[email protected]>

Documentation to include how to use scripts that can help with kernel CVEs introduce by:

e60b1759c1 improve_kernel_cve_report: add script for postprocesing of kernel CVE data 12612e8680 linux/generate-cve-exclusions: use data from CVEProject

---
 documentation/dev-manual/vulnerabilities.rst | 108 +++++++++++++++++++
 1 file changed, 108 insertions(+)
documentation/dev-manual/vulnerabilities.rst +108 -0
index 6cc7f0494..065d853d6 100644
@@ -335,3 +335,111 @@ When analyzing CVEs, it is recommended to:
 -  follow public `open source security mailing lists <https://oss-security.openwall.org/wiki/mailing-lists>`__ for
    discussions and advance notifications of CVE bugs and software releases with fixes.
 
+Linux kernel vulnerabilities
+============================
+
+Since the Linux kernel became a CVE Numbering Authority (CNA), the number of associated CVEs has increased dramatically. Security teams must address these CVEs to meet regulatory and customer requirements. Automation on identifying issue helps to reduce their workload.
+
+OpenEmbedded-core has two scripts that helps to characterize and filter CVEs that affects the Linux kernel, which use one of the following CVE sources:
+
+- https://git.kernel.org/pub/scm/linux/security/vulns.git
+- https://github.com/CVEProject/cvelistV5
+
+The scripts' location are:
+
+-  ``openembedded-core/meta/recipes-kernel/linux/generate-cve-exclusions.py``
+-  ``openembedded-core/scripts/contrib/improve_kernel_cve_report.py``
+
+generate-cve-exclusions.py
+--------------------------
+
+When updating a kernel recipe, a helper script needs to be run manually to update the CVE_STATUS for the kernel recipe. The script can be used for custom kernels. Run it as follows::
+
+   openembedded-core/meta/recipes-kernel/linux/generate-cve-exclusions.py <datadir> <version> > cve-exclusion_<kernel_version>.inc
+
+Example::
+
+   cd openembedded-core/meta/recipes-kernel/linux/
+   ./generate-cve-exclusions.py ~/cvelistV5 6.12.27 > cve-exclusion_6.12.inc
+
+Then the CVE information will automatically be added in the :ref:`ref-classes-cve-check` or :ref:`ref-classes-vex` report.
+
+improve_kernel_cve_report.py
+-----------------------------
+
+The script in ``openembedded-core/scripts/contrib/improve_kernel_cve_report.py`` leverages CVE kernel metadata and the :term:`SPDX_INCLUDE_COMPILED_SOURCES` to update the ``cve-summary.json``. It reduces CVE false positives by 70%-80% and provide detailed responses for all kernel-related CVEs, with the files used to build the kernel. The script is decoupled from the build and can be run outside BitBake.
+
+The script uses the output from :ref:`ref-classes-vex` or :ref:`ref-classes-cve-check` class as input, together with CVE information from the Linux kernel CNA to enrich the ``cve-summary.json``. It creates a new json file with updated CVE information. Optionally, it can also use the list of compiled files from the kernel :term:`SPDX` to ignore CVEs that are not affected because the files are not compiled.
+
+BitBake uses the debug information to extract the sources used to build a binary. Therefore, it needs to be configured in the kernel to extract the kernel compiled files. Enable it by adding the following in your ``local.conf`` or kernel recipe::
+
+   KERNEL_EXTRA_FEATURES:append = " features/debug/debug-kernel.scc"
+
+Or by editing your kernel configuration to include DWARF4 debug information.
+
+The sources for the kernel are stored under ``tmp/pkgdata/<MACHINE>/debugsources/linux-yocto-debugsources.json.zstd``. In order to include the information into the :term:`SPDX` file to filter out source files that are not included in the binaries, add the following in your ``local.conf``::
+
+   SPDX_INCLUDE_COMPILED_SOURCES:pn-linux-yocto = "1"
+
+Finally, store either the ``recipe-linux-yocto.spdx.json`` or the ``linux-yocto-debugsources.json.zstd`` outside the build directory.
+
+The :term:`SPDX` file is under ``tmp/deploy/spdx/3.0.1/<MACHINE>/recipes/recipe-linux-yocto.spdx.json``
+
+Once you have the input data, first you need to clone or fetch the latest CVE information from kernel.org::
+
+   git clone https://git.kernel.org/pub/scm/linux/security/vulns.git
+
+Finally, run the script by using one of the examples bellow. The most exact are the first two examples, using the old cve-summary.json to identify the kernel version.
+
+- Example using old-cve-report as input::
+
+   python3 openembedded-core/scripts/contrib/improve_kernel_cve_report.py --spdx tmp/deploy/spdx/3.0.1/qemux86_64/recipes/recipe-linux-yocto.spdx.json --datadir ./vulns --old-cve-report build/tmp/log/cve/cve-summary.json
+
+- Example using debug-sources file instead of SPDX kernel file::
+
+   python3 openembedded-core/scripts/contrib/improve_kernel_cve_report.py --debug-sources tmp/pkgdata/qemux86_64/debugsources/linux-yocto-debugsources.json.zstd --datadir ./vulns --old-cve-report build/tmp/log/cve/cve-summary.json
+
+- Example using the kernel-version::
+
+   python3 openembedded-core/scripts/contrib/improve_kernel_cve_report.py --spdx tmp/deploy/spdx/3.0.1/qemux86_64/recipes/recipe-linux-yocto.spdx.json --kernel-version 6.12.27 --datadir ./vulns
+
+Example of output for a CVE that the binary does not include the source code due to the kernel configuration::
+
+        {
+          "id": "CVE-2025-38384",
+          "status": "Ignored",
+          "detail": "not-applicable-config",
+          "summary": "In the Linux kernel, the following vulnerability has been resolved (...),
+          "description": "Source code not compiled by config. {'drivers/mtd/nand/spi/core.c'}"
+        },
+
+Example of output for a CVE not in range::
+
+        {
+          "id": "CVE-2025-40017",
+          "status": "Patched",
+          "detail": "fixed-version",
+          "summary": "In the Linux kernel, the following vulnerability has been resolved (...),
+          "description": "only affects 6.15 onwards"
+        }
+
+Example of output for a CVE that is vulnerable::
+
+        {
+          "id": "CVE-2024-58093",
+          "status": "Unpatched",
+          "detail": "version-in-range",
+          "summary": "In the Linux kernel, the following vulnerability has been resolved (...),
+          "description": "Needs backporting (fixed from 6.15)"
+        }
+
+Example of output for a CVE rejected by the Linux CNA::
+
+        {
+          "id": "CVE-2025-38380",
+          "status": "Ignored",
+          "detail": "rejected",
+          "summary": "In the Linux kernel, the following vulnerability has been resolved (...),
+          "description": "Rejected by CNA"
+        }
+
Signature · 1 line
2.34.1
#1 lore raw

Hi,

For the whole patch, please wrap lines to 80 chars as described here:
https://git.yoctoproject.org/yocto-docs/tree/documentation/standards.md#n50

Quoted 26 lines · Daniel Turull via lists.yoctoproject.org

From: Daniel Turull <[email protected]>

Documentation to include how to use scripts that can help with kernel CVEs introduce by:

e60b1759c1 improve_kernel_cve_report: add script for postprocesing of kernel CVE data 12612e8680 linux/generate-cve-exclusions: use data from CVEProject

---
 documentation/dev-manual/vulnerabilities.rst | 108 +++++++++++++++++++
 1 file changed, 108 insertions(+)
documentation/dev-manual/vulnerabilities.rst +5 -0
index 6cc7f0494..065d853d6 100644
@@ -335,3 +335,111 @@ When analyzing CVEs, it is recommended to:
 -  follow public `open source security mailing lists <https://oss-security.openwall.org/wiki/mailing-lists>`__ for
    discussions and advance notifications of CVE bugs and software releases with fixes.
 
+Linux kernel vulnerabilities
+============================
+
+Since the Linux kernel became a CVE Numbering Authority (CNA), the number of associated CVEs has increased dramatically. Security teams must address these CVEs to meet regulatory and customer requirements. Automation on identifying issue helps to reduce their workload.
+

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 10 lines
documentation/dev-manual/vulnerabilities.rst +9 -0
+OpenEmbedded-core has two scripts that helps to characterize and filter CVEs that affects the Linux kernel, which use one of the following CVE sources:
+
+- https://git.kernel.org/pub/scm/linux/security/vulns.git
+- https://github.com/CVEProject/cvelistV5
+
+The scripts' location are:
 
+
+-  ``openembedded-core/meta/recipes-kernel/linux/generate-cve-exclusions.py``
+-  ``openembedded-core/scripts/contrib/improve_kernel_cve_report.py`

I would suggest rephrasing as follows:

"""
:term:OpenEmbedded-Core (OE-Core) has two scripts that help to characterize and filter CVEs that affect the Linux kernel:

- ``meta/recipes-kernel/linux/generate-cve-exclusions.py``
- ``scripts/contrib/improve_kernel_cve_report.py`

Which use one of the following CVE sources:

- https://git.kernel.org/pub/scm/linux/security/vulns.git
- https://github.com/CVEProject/cvelistV5
"""

Are the two sources used by both scripts?

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+generate-cve-exclusions.py

Enclose with ``:

``generate-cve-exclusions.py``

documentation/dev-manual/vulnerabilities.rst

Quoted 3 lines

+--------------------------

documentation/dev-manual/vulnerabilities.rst +2 -0
+
+When updating a kernel recipe, a helper script needs to be run manually to update the CVE_STATUS for the kernel recipe. The script can be used for custom kernels. Run it as follows::

Try to enclose yocto variables with :term:..., so readers can jump to its definition easily. Here: :term:CVE_STATUS.

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+   openembedded-core/meta/recipes-kernel/linux/generate-cve-exclusions.py <datadir> <version> > cve-exclusion_<kernel_version>.inc

Can you elaborate on <datadir>? Does this directory need to be created beforehand? Does it need to be populated with anything, or is it the directory where some temporary data is stored?

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 363

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+Example::
+
+   cd openembedded-core/meta/recipes-kernel/linux/
+   ./generate-cve-exclusions.py ~/cvelistV5 6.12.27 > cve-exclusion_6.12.inc

Maybe I would avoid showing an example that modifies openembedded-core?

Instead:

./openembedded-core/meta/recipes-kernel/linux/generate-cve-exclusions.py ~/cvelistV5 6.12.27 > meta-custom/recipes-kernel/linux/cve-exclusion_6.12.inc

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+Then the CVE information will automatically be added in the :ref:`ref-classes-cve-check` or :ref:`ref-classes-vex` report.

That's only if your kernel recipe is including the file, right? This is the case for linux-yocto, but since you mentioned above that custom kernels can be used, I would add that this file needs to be included in the kernel recipe with:

include cve-exclusion_6.12.inc

Unless I missed something!

Quoted 2 lines

+improve_kernel_cve_report.py
+-----------------------------

Enclose with ``:

``improve_kernel_cve_report.py``

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+The script in ``openembedded-core/scripts/contrib/improve_kernel_cve_report.py`` leverages CVE kernel metadata and the :term:`SPDX_INCLUDE_COMPILED_SOURCES` 

the :term:SPDX_INCLUDE_COMPILED_SOURCES variable

Quoted 1 line

+to update the ``cve-summary.json``

file.

Quoted 1 line

+It reduces CVE false positives by 70%-80% and provide detailed responses for all kernel-related CVEs, with the files used to build the kernel.

s/, with the files used to/by using the files used to/

Quoted 1 line

+The script is decoupled from the build and can be run outside BitBake.

Suggestion:

s/outside BitBake/outside of the :term:BitBake environment/

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+The script uses the output from

the

Quoted 1 line

+:ref:ref-classes-vex or :ref:ref-classes-cve-check class as input, together with CVE information from the Linux kernel CNA to enrich the ``cve-summary.json``

file.

What is this file? Where does it come from?

Maybe say "a ``cve-summary.json`` file with updated CVE information."

Quoted 1 line

+It creates a new json file with updated CVE information.

And remove this sentence, if this new JSON file is cve-summary.json?

documentation/dev-manual/vulnerabilities.rst

Quoted 3 lines
documentation/dev-manual/vulnerabilities.rst +3 -0
+Optionally, it can also use the list of compiled files from the kernel :term:`SPDX` to ignore CVEs that are not affected because the files are not compiled.
+
+BitBake uses the debug information to extract the sources used to build a

"For this, BitBake uses the debug information..."

documentation/dev-manual/vulnerabilities.rst

Quoted 3 lines
documentation/dev-manual/vulnerabilities.rst +3 -0
+binary. Therefore, it needs to be configured in the kernel to extract the
+kernel compiled files. Enable it by adding the following in your
+``local.conf`` or kernel recipe::

"""
If you are using the ``linux-yocto`` recipe, enable it by adding the following in a :term:configuration file or in a ``.bbappend``::
"""

We try to avoid the bad practice of putting everything in local.conf.

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 378

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+
+   KERNEL_EXTRA_FEATURES:append = " features/debug/debug-kernel.scc"
+
+Or by editing your kernel configuration to include DWARF4 debug information.

Please add:

"""
See the :ref:kernel-dev/common:Changing the Configuration section of the Yocto Project Linux Kernel Development Manual for more information.
"""

And:

"""
For the following example, we will consider that the kernel recipe used is ``linux-yocto``. Instructions also apply to other kernel recipes named differently.
"""

documentation/dev-manual/vulnerabilities.rst

Quoted 5 lines
documentation/dev-manual/vulnerabilities.rst +5 -0
+
+The sources for the kernel are stored under
+``tmp/pkgdata/<MACHINE>/debugsources/linux-yocto-debugsources.json.zstd``. In
+order to include the information into the :term:`SPDX` file to filter out
+source files that are not included in the binaries, 

Suggestion:

s/not included in the binaries/not used to compile the kernel/

Quoted 1 line

+add the following in your ``local.conf``::

"""
add the following in a :term:configuration file::
"""

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 384

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+
+   SPDX_INCLUDE_COMPILED_SOURCES:pn-linux-yocto = "1"
+
+Finally, store either the ``recipe-linux-yocto.spdx.json`` or the ``linux-yocto-debugsources.json.zstd`` outside the build directory.

s/build directory/:term:build directory/

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+The :term:`SPDX` file is under ``tmp/deploy/spdx/3.0.1/<MACHINE>/recipes/recipe-linux-yocto.spdx.json``

"""
is stored in ``tmp/deploy/spdx/<spdx_version>/<MACHINE>/recipes/recipe-linux-yocto.spdx.json`` (or ``
"""

Trying to avoid having to maintain the version here if it changes.

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 6 lines
documentation/dev-manual/vulnerabilities.rst +6 -0
+
+Once you have the input data, first you need to clone or fetch the latest CVE information from kernel.org::
+
+   git clone https://git.kernel.org/pub/scm/linux/security/vulns.git
+
+Finally, run the script by using one of the examples bellow. The most exact

s/bellow/below/

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+are the first two examples, using the old cve-summary.json to identify the
+kernel version.

"old"

Maybe just "the ``cve-summary.json`` file" is enough?

Quoted 2 lines

+
+- Example using old-cve-report as input::

"""
Example using ``--old-cve-report``::
"""

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+   python3 openembedded-core/scripts/contrib/improve_kernel_cve_report.py --spdx tmp/deploy/spdx/3.0.1/qemux86_64/recipes/recipe-linux-yocto.spdx.json --datadir ./vulns --old-cve-report build/tmp/log/cve/cve-summary.json

Assuming, but add:

"""
The ``./vulns`` directory will be created if it does not exist.
"""

Quoted 2 lines

+
+- Example using debug-sources file instead of SPDX kernel file::

"""
Example using ``--debug-sources``::
"""

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 402

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+
+   python3 openembedded-core/scripts/contrib/improve_kernel_cve_report.py --debug-sources tmp/pkgdata/qemux86_64/debugsources/linux-yocto-debugsources.json.zstd --datadir ./vulns --old-cve-report build/tmp/log/cve/cve-summary.json
+
+- Example using the kernel-version::

"""
Example using ``--kernel-version``::
"""

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 406

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+
+   python3 openembedded-core/scripts/contrib/improve_kernel_cve_report.py --spdx tmp/deploy/spdx/3.0.1/qemux86_64/recipes/recipe-linux-yocto.spdx.json --kernel-version 6.12.27 --datadir ./vulns
+
+Example of output for a CVE that the binary does not include the source code due to the kernel configuration::

Suggestion:

"""
Example output for a CVE for which the status was changed to "Ignored" because the source files associated to the CVE were not compiled::
"""

Also nitpick but maybe you can use

.. code-block:: json
{
"id": "CVE-2025-38384",
"status": "Ignored",
"detail": "not-applicable-config",
"summary": "In the Linux kernel, the following vulnerability has been resolved (...)", "description": "Source code not compiled by config. {'drivers/mtd/nand/spi/core.c'}"
}

So these snippets render with highlighting.

Quoted 29 lines
documentation/dev-manual/vulnerabilities.rst +29 -0
+
+        {
+          "id": "CVE-2025-38384",
+          "status": "Ignored",
+          "detail": "not-applicable-config",
+          "summary": "In the Linux kernel, the following vulnerability has been resolved (...),
+          "description": "Source code not compiled by config. {'drivers/mtd/nand/spi/core.c'}"
+        },
+
+Example of output for a CVE not in range::
+
+        {
+          "id": "CVE-2025-40017",
+          "status": "Patched",
+          "detail": "fixed-version",
+          "summary": "In the Linux kernel, the following vulnerability has been resolved (...),
+          "description": "only affects 6.15 onwards"
+        }
+
+Example of output for a CVE that is vulnerable::
+
+        {
+          "id": "CVE-2024-58093",
+          "status": "Unpatched",
+          "detail": "version-in-range",
+          "summary": "In the Linux kernel, the following vulnerability has been resolved (...),
+          "description": "Needs backporting (fixed from 6.15)"
+        }
+

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 445

Quoted 10 lines
documentation/dev-manual/vulnerabilities.rst +10 -0
+Example of output for a CVE rejected by the Linux CNA::
+
+        {
+          "id": "CVE-2025-38380",
+          "status": "Ignored",
+          "detail": "rejected",
+          "summary": "In the Linux kernel, the following vulnerability has been resolved (...),
+          "description": "Rejected by CNA"
+        }
+

Thanks for documenting this!
Antonin

Signature · 3 lines
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

Hi,

Thanks for taking a look at the patch and for the comments Antonin. I'll resubmit a new patch with the changes.

Best regards,
Daniel

Quoted 144 lines

-----Original Message-----
From: Antonin Godard <[email protected]>
Sent: Friday, 7 November 2025 15:35
To: Daniel Turull <[email protected]>; [email protected]
Subject: Re: [docs] [PATCH] vulnerabitilies: add section for kernel CVEs vulnerabilities

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi,

For the whole patch, please wrap lines to 80 chars as described here:
https://git.yoct/
oproject.org%2Fyocto- docs%2Ftree%2Fdocumentation%2Fstandards.md%23n50&data=05%7C02%7 Cdaniel.turull%40ericsson.com%7C14407aaf1ca94f51f7c608de1e0ac72e%7C9 2e84cebfbfd47abbe52080c6b87953f%7C0%7C0%7C638981228834746136%7C Unknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDA wMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C% 7C&sdata=U4TVn6PrICtIH4gfk9a8gDij9MTM%2F8IkZeGqEiTMrQo%3D&reserv ed=0

Quoted 21 lines · Daniel Turull via lists.yoctoproject.org

From: Daniel Turull <[email protected]>

Documentation to include how to use scripts that can help with kernel CVEs introduce by:

e60b1759c1 improve_kernel_cve_report: add script for postprocesing of kernel CVE data
12612e8680 linux/generate-cve-exclusions: use data from CVEProject

---
 documentation/dev-manual/vulnerabilities.rst | 108
+++++++++++++++++++
 1 file changed, 108 insertions(+)
documentation/dev-manual/vulnerabilities.rst +0 -0
index 6cc7f0494..065d853d6 100644

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 335

Quoted 1 line
documentation/dev-manual/vulnerabilities.rst +0 -0
@@ -335,3 +335,111 @@ When analyzing CVEs, it is recommended to:
 -  follow public `open source security mailing lists

<https://oss-/
security.openwall.org%2Fwiki%2Fmailing- lists&data=05%7C02%7Cdaniel.turull%40ericsson.com%7C14407aaf1ca94f51f 7c608de1e0ac72e%7C92e84cebfbfd47abbe52080c6b87953f%7C0%7C0%7C63 8981228834777775%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRy dWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3 D%3D%7C0%7C%7C%7C&sdata=%2Fl0xc45IOfQ4VrkFujwiN2qVyDDhEWopUO g9oXjSCWQ%3D&reserved=0>`__ for

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 336

Quoted 1 line
documentation/dev-manual/vulnerabilities.rst +0 -0
    discussions and advance notifications of CVE bugs and software releases

with fixes.

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 5 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+Linux kernel vulnerabilities
+============================
+
+Since the Linux kernel became a CVE Numbering Authority (CNA), the

number of associated CVEs has increased dramatically. Security teams must address these CVEs to meet regulatory and customer requirements. Automation on identifying issue helps to reduce their workload.

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 342

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+OpenEmbedded-core has two scripts that helps to characterize and filter

CVEs that affects the Linux kernel, which use one of the following CVE sources:

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 346

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +3 -0
+
+-
+https://git/
 

+.kernel.org%2Fpub%2Fscm%2Flinux%2Fsecurity%2Fvulns.git&data=05%7C02 %7

Quoted 1 line

+Cdaniel.turull%40ericsson.com%7C14407aaf1ca94f51f7c608de1e0ac72e%7C 92

Quoted 1 line

+e84cebfbfd47abbe52080c6b87953f%7C0%7C0%7C638981228834799412%7C Unknown

Quoted 1 line

+%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIl AiOiJXaW

Quoted 1 line

+4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=R9Zok eEaeF1

documentation/dev-manual/vulnerabilities.rst

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +3 -0
+X6CZu6S2ENs5f%2BqsYftHHXg%2BLclEUj%2BU%3D&reserved=0
+-
+https://git/

+hub.com%2FCVEProject%2FcvelistV5&data=05%7C02%7Cdaniel.turull%40eri cs

Quoted 1 line

+son.com%7C14407aaf1ca94f51f7c608de1e0ac72e%7C92e84cebfbfd47abbe5 2080c

Quoted 1 line

+6b87953f%7C0%7C0%7C638981228834817158%7CUnknown%7CTWFpbGZs b3d8eyJFbXB

Quoted 1 line

+0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFp bCIs

Quoted 1 line

+IldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=DAeZwOzTiZzRJkmwT4LWzgeS 3S3PPQqoq

documentation/dev-manual/vulnerabilities.rst

Quoted 9 lines
documentation/dev-manual/vulnerabilities.rst +8 -0
+qV6zRscO9o%3D&reserved=0
+
+The scripts' location are:
 
+
+-
+``openembedded-core/meta/recipes-kernel/linux/generate-cve-exclusions
+.py``
+-  ``openembedded-core/scripts/contrib/improve_kernel_cve_report.py`

I would suggest rephrasing as follows:

"""
:term:OpenEmbedded-Core (OE-Core) has two scripts that help to characterize and filter CVEs that affect the Linux kernel:

(quoted diff) +0 -2
-  ``meta/recipes-kernel/linux/generate-cve-exclusions.py``
-  ``scripts/contrib/improve_kernel_cve_report.py`

Which use one of the following CVE sources:

-
https://git.kern/
el.org%2Fpub%2Fscm%2Flinux%2Fsecurity%2Fvulns.git&data=05%7C02%7Cd aniel.turull%40ericsson.com%7C14407aaf1ca94f51f7c608de1e0ac72e%7C92e 84cebfbfd47abbe52080c6b87953f%7C0%7C0%7C638981228834832182%7CU nknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAw MCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C &sdata=6NgPPgoRKIdcYNspzuTVMVjzJE0WqjyslvJEdW%2FdL0s%3D&reserved =0
-
https://github/.
com%2FCVEProject%2FcvelistV5&data=05%7C02%7Cdaniel.turull%40ericsson. com%7C14407aaf1ca94f51f7c608de1e0ac72e%7C92e84cebfbfd47abbe52080c 6b87953f%7C0%7C0%7C638981228834845890%7CUnknown%7CTWFpbGZsb 3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkF OIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=36fXNPdLY9D6rQ zQPQavul7KfUc4N30lNhzOHXRxzXk%3D&reserved=0
"""

Quoted 1 line

Are the two sources used by both scripts?

generate-cve-exclusions.py uses only the cvelistV5, while the improve_kernel_cve_report.py could use either. I'll move the sources into their respective section, so it is more clear.

Quoted 17 lines

documentation/dev-manual/vulnerabilities.rst

Quoted 3 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+generate-cve-exclusions.py

Enclose with ``:

``generate-cve-exclusions.py``

documentation/dev-manual/vulnerabilities.rst

Quoted 3 lines

+--------------------------

documentation/dev-manual/vulnerabilities.rst +2 -0
+
+When updating a kernel recipe, a helper script needs to be run manually to

update the CVE_STATUS for the kernel recipe. The script can be used for custom kernels. Run it as follows::

Try to enclose yocto variables with :term:..., so readers can jump to its definition easily. Here: :term:CVE_STATUS.

Quoted 8 lines

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+
+
+ openembedded-core/meta/recipes-kernel/linux/generate-cve-exclusions.
+ py <datadir> <version> > cve-exclusion_<kernel_version>.inc

Can you elaborate on <datadir>? Does this directory need to be created beforehand? Does it need to be populated with anything, or is it the directory where some temporary data is stored?

Sure.

Quoted 10 lines

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 6 lines
documentation/dev-manual/vulnerabilities.rst +5 -0
+Example::
+
+   cd openembedded-core/meta/recipes-kernel/linux/
+   ./generate-cve-exclusions.py ~/cvelistV5 6.12.27 >
+ cve-exclusion_6.12.inc

Maybe I would avoid showing an example that modifies openembedded- core?

Quoted 6 lines

Instead:

./openembedded-core/meta/recipes-kernel/linux/generate-cve-
exclusions.py ~/cvelistV5 6.12.27 > meta-custom/recipes-kernel/linux/cve- exclusion_6.12.inc

That's a good idea. I'll change it

Quoted 11 lines

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+Then the CVE information will automatically be added in the :ref:`ref-

classes-cve-check or :ref:ref-classes-vex` report.

That's only if your kernel recipe is including the file, right? This is the case for linux-yocto, but since you mentioned above that custom kernels can be used, I would add that this file needs to be included in the kernel recipe with:

include cve-exclusion_6.12.inc

Unless I missed something!

You didn't. I'll add it.

Quoted 43 lines
Quoted 3 lines

+improve_kernel_cve_report.py
+-----------------------------

Enclose with ``:

``improve_kernel_cve_report.py``

documentation/dev-manual/vulnerabilities.rst

Quoted 5 lines
documentation/dev-manual/vulnerabilities.rst +5 -0
+
+The script in
+``openembedded-core/scripts/contrib/improve_kernel_cve_report.py``
+leverages CVE kernel metadata and the
+:term:`SPDX_INCLUDE_COMPILED_SOURCES`

the :term:SPDX_INCLUDE_COMPILED_SOURCES variable

Quoted 1 line

+to update the ``cve-summary.json``

file.

Quoted 1 line

+It reduces CVE false positives by 70%-80% and provide detailed responses

for all kernel-related CVEs, with the files used to build the kernel.

s/, with the files used to/by using the files used to/

Quoted 1 line

+The script is decoupled from the build and can be run outside BitBake.

Suggestion:

s/outside BitBake/outside of the :term:BitBake environment/

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+The script uses the output from

the

documentation/dev-manual/vulnerabilities.rst

Quoted 3 lines

+:ref:ref-classes-vex or :ref:ref-classes-cve-check class as

documentation/dev-manual/vulnerabilities.rst +2 -0
+input, together with CVE information from the Linux kernel CNA to
+enrich the ``cve-summary.json``

file.

Quoted 7 lines

What is this file? Where does it come from?

Maybe say "a ``cve-summary.json`` file with updated CVE information."

Quoted 1 line

+It creates a new json file with updated CVE information.

And remove this sentence, if this new JSON file is cve-summary.json?

It creates a new file. I'll clarify it.

Quoted 19 lines
Quoted 2 lines

+Optionally, it can also use the list of compiled files from the kernel

:term:SPDX to ignore CVEs that are not affected because the files are not compiled.

documentation/dev-manual/vulnerabilities.rst

Quoted 3 lines
documentation/dev-manual/vulnerabilities.rst +3 -0
+
+BitBake uses the debug information to extract the sources used to
+build a

"For this, BitBake uses the debug information..."

documentation/dev-manual/vulnerabilities.rst

Quoted 3 lines
documentation/dev-manual/vulnerabilities.rst +3 -0
+binary. Therefore, it needs to be configured in the kernel to extract
+the kernel compiled files. Enable it by adding the following in your
+``local.conf`` or kernel recipe::

"""
If you are using the ``linux-yocto`` recipe, enable it by adding the following in a :term:configuration file or in a ``.bbappend``::
"""

Quoted 1 line

We try to avoid the bad practice of putting everything in local.conf.

Ok

Quoted 109 lines

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 5 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+
+   KERNEL_EXTRA_FEATURES:append = " features/debug/debug-kernel.scc"
+
+Or by editing your kernel configuration to include DWARF4 debug

information.

Please add:

"""
See the :ref:kernel-dev/common:Changing the Configuration section of the Yocto Project Linux Kernel Development Manual for more information. """

And:

"""
For the following example, we will consider that the kernel recipe used is ``linux-yocto``. Instructions also apply to other kernel recipes named differently.
"""

documentation/dev-manual/vulnerabilities.rst

Quoted 3 lines
documentation/dev-manual/vulnerabilities.rst +3 -0
+
+The sources for the kernel are stored under
+``tmp/pkgdata/<MACHINE>/debugsources/linux-yocto-

debugsources.json.zs

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+td``. In order to include the information into the :term:`SPDX` file
+to filter out source files that are not included in the binaries,

Suggestion:

s/not included in the binaries/not used to compile the kernel/

Quoted 1 line

+add the following in your ``local.conf``::

"""
add the following in a :term:configuration file::
"""

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+
+   SPDX_INCLUDE_COMPILED_SOURCES:pn-linux-yocto = "1"
+
+Finally, store either the ``recipe-linux-yocto.spdx.json`` or the ``linux-yocto-

debugsources.json.zstd`` outside the build directory.

s/build directory/:term:build directory/

documentation/dev-manual/vulnerabilities.rst

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+
+The :term:`SPDX` file is under
+``tmp/deploy/spdx/3.0.1/<MACHINE>/recipes/recipe-linux-yocto.spdx.jso
+n``

"""
is stored in ``tmp/deploy/spdx/<spdx_version>/<MACHINE>/recipes/recipe- linux-yocto.spdx.json``
(or ``
"""

Trying to avoid having to maintain the version here if it changes.

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+
+Once you have the input data, first you need to clone or fetch the latest

CVE information from kernel.org::

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 342

Quoted 4 lines
documentation/dev-manual/vulnerabilities.rst +4 -0
+
+   git clone
+ https://gi/
+

t.kernel.org%2Fpub%2Fscm%2Flinux%2Fsecurity%2Fvulns.git&data=05%7C02

Quoted 1 line

+

%7Cdaniel.turull%40ericsson.com%7C14407aaf1ca94f51f7c608de1e0ac72e% 7

Quoted 1 line

+

C92e84cebfbfd47abbe52080c6b87953f%7C0%7C0%7C638981228834859134% 7CUnk

Quoted 1 line

+

nown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwM CIsIlAiO

Quoted 1 line

+

iJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=b Zxe7

documentation/dev-manual/vulnerabilities.rst

Quoted 4 lines

+ yzrnHp7%2FGU0rBBrzfdcdhMjTaJl8VR0AnJyn2Q%3D&reserved=0

documentation/dev-manual/vulnerabilities.rst +3 -0
+
+Finally, run the script by using one of the examples bellow. The most
+exact

s/bellow/below/

documentation/dev-manual/vulnerabilities.rst

Quoted 2 lines
documentation/dev-manual/vulnerabilities.rst +2 -0
+are the first two examples, using the old cve-summary.json to
+identify the kernel version.

"old"

Maybe just "the ``cve-summary.json`` file" is enough?

Quoted 2 lines

+
+- Example using old-cve-report as input::

"""
Example using ``--old-cve-report``::
"""

documentation/dev-manual/vulnerabilities.rst

Quoted 7 lines
documentation/dev-manual/vulnerabilities.rst +7 -0
+
+   python3
+ openembedded-core/scripts/contrib/improve_kernel_cve_report.py
+ --spdx
+ tmp/deploy/spdx/3.0.1/qemux86_64/recipes/recipe-linux-yocto.spdx.jso
+ n --datadir ./vulns --old-cve-report
+ build/tmp/log/cve/cve-summary.json
Quoted 6 lines

Assuming, but add:

"""
The ``./vulns`` directory will be created if it does not exist.
"""

No. It is not created. It is the git repo clone in the previous step. I'll change the path so it is more clear.

Quoted 33 lines
Quoted 2 lines

+
+- Example using debug-sources file instead of SPDX kernel file::

"""
Example using ``--debug-sources``::
"""

documentation/dev-manual/vulnerabilities.rst

Quoted 5 lines
documentation/dev-manual/vulnerabilities.rst +5 -0
+
+   python3
+ openembedded-core/scripts/contrib/improve_kernel_cve_report.py
+ --debug-sources
+ tmp/pkgdata/qemux86_64/debugsources/linux-yocto-

debugsources.json.zs

Quoted 4 lines

+ td --datadir ./vulns --old-cve-report
+ build/tmp/log/cve/cve-summary.json
+
+- Example using the kernel-version::

"""
Example using ``--kernel-version``::
"""

documentation/dev-manual/vulnerabilities.rst

Quoted 8 lines
documentation/dev-manual/vulnerabilities.rst +8 -0
+
+   python3
+ openembedded-core/scripts/contrib/improve_kernel_cve_report.py
+ --spdx
+ tmp/deploy/spdx/3.0.1/qemux86_64/recipes/recipe-linux-yocto.spdx.jso
+ n --kernel-version 6.12.27 --datadir ./vulns
+
+Example of output for a CVE that the binary does not include the source

code due to the kernel configuration::

Suggestion:

Quoted 8 lines

"""
Example output for a CVE for which the status was changed to "Ignored" because the source files associated to the CVE were not compiled::
"""

Also nitpick but maybe you can use

.. code-block:: json

I was not aware. That's a good suggestion.

Quoted 70 lines
   {
     "id": "CVE-2025-38384",
     "status": "Ignored",
     "detail": "not-applicable-config",
     "summary": "In the Linux kernel, the following vulnerability has been

resolved (...)",
"description": "Source code not compiled by config.
{'drivers/mtd/nand/spi/core.c'}"
}

So these snippets render with highlighting.

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 6 lines
documentation/dev-manual/vulnerabilities.rst +6 -0
+
+        {
+          "id": "CVE-2025-38384",
+          "status": "Ignored",
+          "detail": "not-applicable-config",
+          "summary": "In the Linux kernel, the following vulnerability has been

resolved (...),

Quoted 1 line

+ "description": "Source code not compiled by config.

{'drivers/mtd/nand/spi/core.c'}"

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 9 lines
documentation/dev-manual/vulnerabilities.rst +9 -0
+        },
+
+Example of output for a CVE not in range::
+
+        {
+          "id": "CVE-2025-40017",
+          "status": "Patched",
+          "detail": "fixed-version",
+          "summary": "In the Linux kernel, the following vulnerability has been

resolved (...),

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 10 lines
documentation/dev-manual/vulnerabilities.rst +10 -0
+          "description": "only affects 6.15 onwards"
+        }
+
+Example of output for a CVE that is vulnerable::
+
+        {
+          "id": "CVE-2024-58093",
+          "status": "Unpatched",
+          "detail": "version-in-range",
+          "summary": "In the Linux kernel, the following vulnerability has been

resolved (...),

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to:

Quoted 10 lines
documentation/dev-manual/vulnerabilities.rst +10 -0
+          "description": "Needs backporting (fixed from 6.15)"
+        }
+
+Example of output for a CVE rejected by the Linux CNA::
+
+        {
+          "id": "CVE-2025-38380",
+          "status": "Ignored",
+          "detail": "rejected",
+          "summary": "In the Linux kernel, the following vulnerability has been

resolved (...),

documentation/dev-manual/vulnerabilities.rst When analyzing CVEs, it is recommended to: · line 445

Quoted 3 lines
documentation/dev-manual/vulnerabilities.rst +3 -0
+          "description": "Rejected by CNA"
+        }
+

Thanks for documenting this!
Antonin

--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin/
.com%2F&data=05%7C02%7Cdaniel.turull%40ericsson.com%7C14407aaf1ca9 4f51f7c608de1e0ac72e%7C92e84cebfbfd47abbe52080c6b87953f%7C0%7C0% 7C638981228834870707%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGki OnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoy fQ%3D%3D%7C0%7C%7C%7C&sdata=zTAqx%2FlcImFmVQ4qngBprGULnaZipe QsWJeRu9fBw6k%3D&reserved=0