feat(yocto): kernel CVEs the kernel configuration does not build (#150) #858

Merged
sharang merged 1 commits from feat/yocto-kernel-cve-config into main 2026-11-05 00:00:51 +00:00
Owner

#150 follow-up: kernel CVEs filtered by the kernel configuration. Tracker #167.

Approach

Prüfwerk does not reimplement kernel filtering. It uses Yocto's own script, scripts/contrib/improve_kernel_cve_report.py, which ships with OE-Core since Scarthgap 5.0. The script compares every kernel CVE of the Linux kernel CNA (the vulns repository, with each CVE's program files) against the files the kernel actually compiled, using the build's debugsources list. It then writes the cve-check report again. That report is uploaded as a build output in place of the image's, and the cve-check reader from #854 handles it.

Verified on the ferrite build (scarthgap 5.0.21, core-image-minimal qemuarm64, linux-yocto 6.6.151), with no rebuild needed:

  • 22,001 kernel CVEs in total;
  • 2,230 Ignored not-applicable-config (not compiled);
  • 337 Ignored rejected;
  • 953 Unpatched;
  • the rest Patched.

What

  • rejected (withdrawn by the CNA) now becomes not_affected.
  • Patched version-not-in-range now becomes not_affected (vulnerable code not present) instead of fixed, since the version is simply not affected.
  • Fixture fixtures/yocto/linux-yocto.improved-cve-report.json: a trimmed copy of that run, two CVEs for each verdict, with no local paths.
  • Docs (guide/yocto): a new paragraph Kernel CVEs and the kernel configuration, with the commands and the result above, plus the two new mapping rows.

Tests

  • Unit test the_kernel_report_filtered_by_compiled_files_settles_kernel_cves:
    • not-applicable-config, rejected and version-not-in-range become not affected;
    • fixed-version and cpe-stable-backport become fixed;
    • version-in-range stays open.
  • CI only.

🤖 Generated with Claude Code

#150 follow-up: kernel CVEs filtered by the kernel configuration. Tracker #167. ## Approach Prüfwerk does not reimplement kernel filtering. It uses Yocto's own script, `scripts/contrib/improve_kernel_cve_report.py`, which ships with OE-Core since Scarthgap 5.0. The script compares every kernel CVE of the Linux kernel CNA (the `vulns` repository, with each CVE's program files) against the files the kernel actually compiled, using the build's `debugsources` list. It then writes the cve-check report again. That report is uploaded as a build output in place of the image's, and the cve-check reader from #854 handles it. **Verified on the ferrite build** (scarthgap 5.0.21, core-image-minimal qemuarm64, linux-yocto 6.6.151), with no rebuild needed: - 22,001 kernel CVEs in total; - **2,230** Ignored `not-applicable-config` (not compiled); - **337** Ignored `rejected`; - 953 Unpatched; - the rest Patched. ## What - `rejected` (withdrawn by the CNA) now becomes `not_affected`. - Patched `version-not-in-range` now becomes `not_affected` (vulnerable code not present) instead of `fixed`, since the version is simply not affected. - **Fixture** `fixtures/yocto/linux-yocto.improved-cve-report.json`: a trimmed copy of that run, two CVEs for each verdict, with no local paths. - **Docs** (`guide/yocto`): a new paragraph *Kernel CVEs and the kernel configuration*, with the commands and the result above, plus the two new mapping rows. ## Tests - Unit test `the_kernel_report_filtered_by_compiled_files_settles_kernel_cves`: - not-applicable-config, rejected and version-not-in-range become not affected; - fixed-version and cpe-stable-backport become fixed; - version-in-range stays open. - CI only. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-11-04 23:45:20 +00:00
feat(yocto): kernel CVEs the kernel configuration does not build (#150)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 3m36s
CI / Check (pull_request) Successful in 15m19s
ac2c4b2cab
Yocto's scripts/contrib/improve_kernel_cve_report.py (OE-Core, since
Scarthgap) checks every kernel CVE of the Linux kernel CNA against the
files the kernel compiled (the build's debug-sources list) and writes
the cve-check report again: Ignored not-applicable-config for code the
configuration does not build, Ignored rejected for withdrawn CVEs,
Patched version-not-in-range outside the affected versions. Uploaded as
a build output, it goes through the cve-check reader (#854).

- rejected becomes not affected; Patched version-not-in-range becomes
  not affected (vulnerable code not present) instead of fixed.
- guide/yocto: how to produce the report (no rebuild needed) and the
  mapping rows.
- Fixture: a trimmed copy of the report over a real scarthgap kernel
  (linux-yocto 6.6.151, core-image-minimal qemuarm64), two CVEs per
  verdict; on the full image 2,230 of 22,001 kernel CVEs were not
  applicable for the configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang merged commit b531227b45 into main 2026-11-05 00:00:51 +00:00
Sign in to join this conversation.