🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.kernel
Article #970

Re: [PATCH v2 04/11] Documentation: Describe kconfig-audit usage and design

#970
From: sashiko-bot
Date: Fri, 04 Dec 2026 23:10
94 lines
5616 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Low] docs: kconfig-audit exact-rule precedence contradicts
  _map_pattern_rules()
- [Low] docs: kconfig-audit enabled pattern rule misses zero-match
  failure
- [Low] docs: kconfig-audit Invocation section omits -P / --policy-file
  option
- [Low] docs: kconfig-audit omits duplicate name_pattern rule rejection
--

commit b13b53469deef91d63f2604f80547d95c6a4d51c
Author: Ahmed S. Darwish <darwi@linutronix.de>

Documentation: Describe kconfig-audit usage and design

This commit documents kconfig-audit usage, policy format, and dependencies,
links it from the PREEMPT_RT configuration guide, and references the new
documentation in the missing-dependency error message.

> diff --git a/Documentation/tools/kconfig-audit.rst b/Documentation/tools/kconfig-audit.rst
> new file mode 100644
> index 0000000000000..5b8e2fa842b1e
> --- /dev/null
> +++ b/Documentation/tools/kconfig-audit.rst
> @@ -0,0 +1,517 @@

[ ... ]

> +Check a ``.config`` against a policy known to the checker::
> +
> +   audit.py check -c path/to/.config -p preempt_rt

[Severity: Low]
Should this section also document -P / --policy-file?  parse_args() in
tools/kconfig-audit/audit.py supports checking against a custom policy
file, but this option is not mentioned anywhere in the document despite
the policy authoring guide below.

[ ... ]

> +Note that pattern priority conflicts are detected only for symbols present
> +in the checked ``.config``.  An exact ``name`` rule continues to take
> +precedence over all pattern rules for such symbols.

[Severity: Low]
Does this match Checker._map_pattern_rules() in
tools/kconfig-audit/audit.py?

Checker.__post_init__() calls _map_pattern_rules() before
_find_pattern_rule_issues() checks exact rule precedence.  When a symbol
in .config matches multiple highest-priority pattern rules, audit.py
aborts with EX_DATAERR even if an exact name rule covers that symbol.

Either _map_pattern_rules() should skip symbols covered by an exact rule,
or this note should reflect that conflicts are still rejected.

> +
> +Duplicate rules are rejected
> +----------------------------
> +
> +Duplicate exact symbol rules are rejected.  The policy below:

[Severity: Low]
Should this section also mention duplicate name_pattern rules?
Policy.add_rule() in tools/kconfig-audit/audit.py rejects identical
name_pattern strings at parse time with EX_DATAERR, even when they have
different pattern_prio values or match no symbols in .config.

[ ... ]

> +``enabled``
> +   The symbol must be set to ``y`` or ``m``.
> +
> +   For an exact ``name`` rule, a missing symbol fails an ``enabled`` rule.
> +   An explicitly unset symbol also fails.  For a ``name_pattern`` rule, the
> +   rule applies only to symbols matched in the checked ``.config``.

[Severity: Low]
Is this accurate for an enabled name_pattern rule that matches nothing in
.config?

In tools/kconfig-audit/audit.py, Checker._find_pattern_rule_issues()
reports an issue and exits with EX_CONFIG when an expected: enabled
pattern rule matches zero symbols in .config, unless an exact symbol rule
in the policy matches the regex.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203224916.118064-1-darwi@linutronix.de?part=4
Technical Details
Message-ID: <O6KzE-g1p2-49@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <O6o65-fPfD-3@gated-at.bofh.it> <O6o65-fPfD-15@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!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 04/11] Documentation: Describe kconfig-audit usage  and design
Date: Sat, 05 Dec 2026 00:10:02 +0100
Message-ID: <O6KzE-g1p2-49@gated-at.bofh.it>
References: <O6o65-fPfD-3@gated-at.bofh.it> <O6o65-fPfD-15@gated-at.bofh.it>
X-Mailbox-Line: From debian-kernel-request@lists.debian.org  Fri Dec  4 23:06:31 2026
Old-Return-Path: <sashiko-bot@kernel.org>
X-Amavis-Spam-Status: No, score=-2.801 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_LOW=-0.7] 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/158751
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-250776@kernel.org
Approved: robomod@news.nic.it
Lines: 94
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:11 +0000
X-Original-Message-ID: <sashiko-outbox-250776@kernel.org>
X-Original-References: <20261203224916.118064-1-darwi@linutronix.de>
 <20261203224916.118064-5-darwi@linutronix.de>