Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Perale via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Thomas Perale <thomas.perale@mind.be>,
	Ricardo Martincoski <ricardo.martincoski@datacom.com.br>
Subject: [Buildroot] [RFC PATCH 02/14] utils/checkpackagelib/lib_mk.py: check _STATUS value is supported
Date: Wed, 24 Jun 2026 16:06:33 +0200	[thread overview]
Message-ID: <20260624140645.185318-3-thomas.perale@mind.be> (raw)
In-Reply-To: <20260624140645.185318-1-thomas.perale@mind.be>

Check that `<pkg>_<vuln-id>_STATUS` variable values are using a status
value supported.

Signed-off-by: Thomas Perale <thomas.perale@mind.be>
---
 utils/checkpackagelib/lib_mk.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/utils/checkpackagelib/lib_mk.py b/utils/checkpackagelib/lib_mk.py
index 5d48e8929c..6201d324fa 100644
--- a/utils/checkpackagelib/lib_mk.py
+++ b/utils/checkpackagelib/lib_mk.py
@@ -443,3 +443,25 @@ class CPEVariables(_CheckFunction):
             if field == "VALID":
                 self.valid = {"lineno": lineno, "text": text}
             self.non_defaults += 1
+
+
+class VulnerabilityStatus(_CheckFunction):
+    VALID_STATUSES = [
+        "fixed",
+        "not-affected-component-not-present",
+        "not-affected-vulnerable-code-not-present",
+        "not-affected-vulnerable-code-not-in-execute-path",
+        "not-affected-vulnerable-code-cannot-be-controlled-by-adversary",
+    ]
+    CVE_STATUS = re.compile(r"^[A-Z0-9_]+(CVE-\d{4}-\d+)_STATUS\s*=\s*(\S+)")
+
+    def check_line(self, lineno, text):
+        m = self.CVE_STATUS.match(text.rstrip())
+        if m is None:
+            return
+        status = m.group(2)
+        if status not in self.VALID_STATUSES:
+            return ["{}:{}: invalid _STATUS value '{}', expected one of: {} ({})".format(
+                self.filename, lineno, status,
+                ", ".join(self.VALID_STATUSES), self.url_to_manual),
+                text]
-- 
2.54.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-06-24 14:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24 14:06 [Buildroot] [RFC PATCH 00/14] Add exportable vulnerability informations Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 01/14] docs/manual: add vulnerability status and justification Thomas Perale via buildroot
2026-06-24 14:06 ` Thomas Perale via buildroot [this message]
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 03/14] package/pkg-utils: show-info expose vuln details Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 04/14] utils/generate-cyclonedx: support vulnerability details Thomas Perale via buildroot
2026-06-25 18:01   ` Fiona Klute via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 05/14] package/sox: add vulnerabilities details Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 06/14] package/php: add vulnerability details Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 07/14] package/mupdf: add vulnerabilities details Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 08/14] package/python-pip: add detail to vulnerability Thomas Perale via buildroot
2026-06-25 17:57   ` Fiona Klute via buildroot
2026-06-26  7:25     ` Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 09/14] package/luajit: add details to vulnerabilities Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 10/14] package/libuci: add vulnerability details Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 11/14] package/glibc: " Thomas Perale via buildroot
2026-06-24 14:45   ` Romain Naour via buildroot
2026-06-24 15:06     ` Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 12/14] package/freeradius-server: add vulnerabilities details Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 13/14] package/flex: add vulnerability details Thomas Perale via buildroot
2026-06-24 14:06 ` [Buildroot] [RFC PATCH 14/14] package/clamav: " Thomas Perale via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260624140645.185318-3-thomas.perale@mind.be \
    --to=buildroot@buildroot.org \
    --cc=ricardo.martincoski@datacom.com.br \
    --cc=thomas.perale@mind.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox