Re: [PATCH v2 06/11] kconfig-audit: Introduce policy overlays schema

From: sashiko-bot

Date: Fri Dec 04 2026 - 17:50:21 EST


Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] kconfig-audit: overlay schema accepts selector-only no-op rule
entries
- [Low] kconfig-audit: policy-overlay-v1.yml title omits overlay
--

commit 58352cb3df2432252016c1d667a0a661fb223c7b
Author: Ahmed S. Darwish <darwi@xxxxxxxxxxxxx>

kconfig-audit: Introduce policy overlays schema

This commit adds the JSON Schema for kconfig-audit policy overlay files,
reusing the shared rule definitions in rule.yml, and updates the neutral
rule description to mention overlays.

> diff --git a/tools/kconfig-audit/schema/policy-overlay-v1.yml b/tools/kconfig-audit/schema/policy-overlay-v1.yml
> new file mode 100644
> index 0000000000000..d95e9197a53c5
> --- /dev/null
> +++ b/tools/kconfig-audit/schema/policy-overlay-v1.yml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +"$schema": "https://json-schema.org/draft-07/schema#";
> +
> +title: kconfig-audit policy schema

[Severity: Low]
This title matches policy-v1.yml; should it be "kconfig-audit policy overlay
schema"?

[ ... ]

> + rules:
> + type: array
> + minItems: 1
> + items:
> + allOf:
> + - $ref: "rule.yml#/definitions/rule"

[Severity: Low]
Can an overlay rule entry pass validation with only name or name_pattern and
no override fields?

definitions.rule in rule.yml only requires name or name_pattern and leaves
all override fields optional. Since audit.py relies on the schema rather
than re-validating during parsing, a selector-only rule (such as forgetting
expected: neutral) silently becomes a no-op against an existing base rule.

Adding minProperties: 2 alongside the rule $ref in allOf would reject
selector-only entries.

--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203224916.118064-1-darwi@xxxxxxxxxxxxx?part=6