Re: [PATCH v2 01/11] kconfig-audit: Add schema for policy files
From: sashiko-bot
Date: Fri Dec 04 2026 - 17:50:13 EST
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@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx?part=1