mbox series

[scarthgap,v2,0/8] Scope global CVE exclusions by product

Message ID 20261201100231.3119168-1-peter.tatrai.ext@siemens.com
Headers show
Series Scope global CVE exclusions by product | expand

Message

P. Tatrai Dec. 1, 2026, 10:02 a.m. UTC
From: Peter Tatrai <peter.tatrai.ext@siemens.com>

This series backports product-scoped CVE_STATUS entries
("detail: cpe:vendor:product:description") from master. Without it,
scarthgap applies every entry in cve-extra-exclusions.inc to every recipe,
so e.g. a Berkeley DB CVE is reported as Ignored for zlib in SPDX/VEX.

Before/after, CVE_STATUS[CVE-2020-2981] (berkeley_db) in SPDX:

    recipe  before                       after
    db      Ignored / upstream-wontfix   Ignored / upstream-wontfix
    zlib    Ignored / upstream-wontfix   not reported

Changes since v1 [1]:
- The two squashed commits are split into separate backports of
  abca80a716 (patch 1) and 452e605b55 (patch 2). The parser and
  has_cve_product_match() are taken verbatim from master; the commit
  messages list what is not picked and why.
- The master follow-up fixes to the parser are picked as separate
  cherry-picks (patches 3-5), together with the master selftest
  test_product_match (patch 6), instead of being folded in.
- Scarthgap callers (cve-check, vex.bbclass, spdx30_tasks) still use the
  (status, detail, description) tuple API, so the master caller hunks are
  not backported. decode_cve_status() keeps that API and applies product
  matching. One documented difference from master: unscoped entries
  still apply when CVE_PRODUCT is empty, where master drops them.
- The "Skipping ... missing or unknown CVE status" bb.warn lines in
  vex.bbclass and spdx30_tasks.py are removed in patch 2, with the
  reason explained in the commit message.
- No release names in code comments.
- Patch 8 explains how it was checked that no fixed CVE is reopened.

Bisect note: patches 1-2 bring master's parser as it was first merged.
Until patch 4, a description containing ':' is truncated (for example a
URL); until patch 5, an invalid detail raises NameError instead of a
warning. I kept this order so that every patch can be compared with its
master commit.

Testing: "oe-selftest -r cve_check" passes on scarthgap with this series
(9 tests, including test_image_json and the test_recipe_report_json*
builds).
For patch 8, the old and new cve-extra-exclusions.inc were run through
the cve-check and SPDX helpers for the eight named products: all 43 CVE
IDs keep their status, detail and description. Against a local NVD
snapshot, 42 are Ignored before and after, and none becomes Unpatched.
CVE-2011-0640 is listed under udev, not linux_kernel, in NVD, so
cve-check does not report it for the kernel either before or after.
This comparison used the helper functions directly, not an image build.

[1] https://lists.openembedded.org/g/openembedded-core/topic/122363978

Colin McAllister (1):
  cve-check: Fix errors in log lines

Marta Rybczynska (2):
  selftest: add test_product_match
  cve-extra-inclusions: encode CPEs of affected packages

Peter Marko (2):
  cve-check: do not skip cve status description after :
  cve-check: fix malformed cve status description with : characters

Peter Tatrai (3):
  cve-check: decode product and vendor in CVE_STATUS
  cve-check: only apply CVE_STATUS to matching products
  selftest: test scoped CVE_STATUS on scarthgap

 meta/classes/vex.bbclass                      |   1 -
 .../distro/include/cve-extra-exclusions.inc   |  24 ++---
 meta/lib/oe/cve_check.py                      |  75 +++++++++++--
 meta/lib/oe/spdx30_tasks.py                   |   1 -
 meta/lib/oeqa/selftest/cases/cve_check.py     | 102 ++++++++++++++++++
 5 files changed, 181 insertions(+), 22 deletions(-)