Article View: linux.debian.kernel
Article #964Re: [PATCH v2 01/11] kconfig-audit: Add schema for policy files
From: sashiko-bot
Date: Fri, 04 Dec 2026 23:10
Date: Fri, 04 Dec 2026 23:10
81 lines
5169 bytes
5169 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Low] kconfig-audit: policy schema name pattern rejects lowercase
Kconfig symbols
- [Low] kconfig-audit: non-canonical https:// URI in Draft-07 $schema
- [Low] kconfig-audit: docs_hint schema pattern allows # in URI
fragments
--
commit 922516e5e1ce33b868280571209d1adde89b4e80
Author: Ahmed S. Darwish <darwi@linutronix.de>
kconfig-audit: Add schema for policy files
This commit defines the JSON Schema for kconfig-audit policy files in
tools/kconfig-audit/schema/policy-v1.yml and documents the purpose of each
field.
> diff --git a/tools/kconfig-audit/schema/policy-v1.yml b/tools/kconfig-audit/schema/policy-v1.yml
> new file mode 100644
> index 0000000000000..10672226415be
> --- /dev/null
> +++ b/tools/kconfig-audit/schema/policy-v1.yml
> @@ -0,0 +1,139 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +"$schema": "https://json-schema.org/draft-07/schema#"
[Severity: Low]
Should $schema use the canonical Draft-07 URI
"http://json-schema.org/draft-07/schema#" instead of https://?
Draft-07 identifies its meta-schema with http://, and validators match
$schema as a literal URI identifier rather than following HTTP redirects.
External validators that dispatch on $schema (such as check-jsonschema)
will not recognize the https:// URI as Draft-07 and will reject it or warn.
[ ... ]
> + #
> + # Exact kernel configuration symbol to check.
> + #
> + # Example: CONFIG_PREEMPT_RT
> + #
> + name:
> + type: string
> + pattern: '^CONFIG_[A-Z0-9_]+$'
[Severity: Low]
Does this pattern reject valid Kconfig symbols that contain lowercase
letters?
scripts/kconfig/lexer.l allows [A-Za-z0-9_-] in symbol names, and mainline
Kconfig files define symbols such as CONFIG_VFPv3 and CONFIG_SCx200. Any
policy referencing one of those symbols will fail schema validation;
relaxing the pattern to '^CONFIG_[A-Za-z0-9_-]+$' would match Kconfig.
[ ... ]
> + # If `docs_hint` is any other string, that string is used directly as
> + # the HTML fragment identifier.
> + #
> + docs_hint:
> + type: string
> + anyOf:
> + - const: config
> + - pattern: '^\S+$' # URI fragments cannot have spaces
[Severity: Low]
Can docs_hint accept '#' characters and produce malformed rationale URLs?
Because '#' is non-whitespace, '^\S+$' allows values like "#my-section",
which is an easy mistake given the "#config-drm" example above and causes
the checker to emit a double-hash URL ("##my-section"). Tightening the
pattern to '^[^\s#]+$' and noting to omit a leading '#' would prevent this.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203224916.118064-1-darwi@linutronix.de?part=1
Technical Details
Message-ID:
<O6KzE-g1p2-21@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.hispagatos.org!news.nntp4.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<O6o65-fPfD-3@gated-at.bofh.it> <O6o65-fPfD-1@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.hispagatos.org!news.nntp4.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: sashiko-bot@kernel.org Newsgroups: linux.debian.kernel,linux.kernel Subject: Re: [PATCH v2 01/11] kconfig-audit: Add schema for policy files Date: Sat, 05 Dec 2026 00:10:02 +0100 Message-ID: <O6KzE-g1p2-21@gated-at.bofh.it> References: <O6o65-fPfD-3@gated-at.bofh.it> <O6o65-fPfD-1@gated-at.bofh.it> X-Mailbox-Line: From debian-kernel-request@lists.debian.org Fri Dec 4 23:06:09 2026 Old-Return-Path: <sashiko-bot@kernel.org> X-Amavis-Spam-Status: No, score=-4.401 tagged_above=-10000 required=5.3 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate: -5.5 Reply-To: sashiko-reviews@lists.linux.dev Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailing-List: <debian-kernel@lists.debian.org> archive/latest/158749 List-ID: <debian-kernel.lists.debian.org> List-URL: <https://lists.debian.org/debian-kernel/> List-Archive: https://lists.debian.org/msgid-search/sashiko-outbox-250773@kernel.org Approved: robomod@news.nic.it Lines: 81 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>, "Frederic Weisbecker" <frederic@kernel.org>, "John Ogness" <john.ogness@linutronix.de>, "Derek Barbosa" <debarbos@redhat.com>, Zbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>, "Daan De Meyer" <daan.j.demeyer@gmail.com>, "Luca Boccassi" <luca.boccassi@gmail.com>, linux-rt-devel@lists.linux.dev, debian-kernel@lists.debian.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org X-Original-Date: Fri, 04 Dec 2026 22:50:07 +0000 X-Original-Message-ID: <sashiko-outbox-250773@kernel.org> X-Original-References: <20261203224916.118064-1-darwi@linutronix.de> <20261203224916.118064-2-darwi@linutronix.de>