Article View: linux.debian.kernel
Article #971Re: [PATCH v2 10/11] kconfig: Introduce auditconfig target
From: sashiko-bot
Date: Fri, 04 Dec 2026 23:10
Date: Fri, 04 Dec 2026 23:10
112 lines
6632 bytes
6632 bytes
Thank you for your contribution! Sashiko AI review found 5 potential issues to consider: - [Low] kconfig: auditconfig pipeline masks audit.py startup and dependency failures - [Low] kconfig: auditconfig validates POLICY with grep -qw instead of grep -Fxq -- - [Low] kconfig: relative OVERLAY paths fail under O= builds in auditconfig - [Low] kconfig: auditconfig uses echo -n with newline-separated list-policies output - [Low] kconfig: unresolved maintainer objection to auditconfig Makefile target -- commit 6f54ed0a60b4e5e9fac14ed041af880ff3de56ee Author: Ahmed S. Darwish <darwi@linutronix.de> kconfig: Introduce auditconfig target This commit adds an auditconfig Kbuild target in scripts/kconfig/Makefile to check the current .config against a selected kconfig-audit policy and optional overlay, and lists the target in make help. > diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile > index 5baf1c44ffa25..b216761c534f8 100644 > --- a/scripts/kconfig/Makefile > +++ b/scripts/kconfig/Makefile > @@ -125,6 +125,28 @@ testconfig: $(obj)/conf > $(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no) > clean-files += tests/.cache > > +auditconfig := $(PYTHON3) -B $(srctree)/tools/kconfig-audit/audit.py > +auditconfig_overlay = $(if $(OVERLAY),-o "$(OVERLAY)") [Severity: Low] Will a relative OVERLAY path work in out-of-tree O= builds? The top-level Makefile re-invokes make with -C $(abs_output), so audit.py opens OVERLAY relative to the output directory instead of the source or invocation directory. A relative path such as OVERLAY=my-overlay.yml then fails with No such file or directory unless the file is inside the O= tree. Canonicalizing OVERLAY before changing directories or falling back to $(srctree)/$(OVERLAY) would handle this. > + > +list_auditconfig_rules = \ > + echo -n >&2 "Available POLICY: "; \ > + $(auditconfig) list-policies >&2; \ > + echo >&2 [Severity: Low] Will echo -n misalign the policy list once more than one policy exists? audit.py list-policies prints one policy name per line, so the first policy appears inline after "Available POLICY: " while every subsequent policy prints unindented at column 0. Joining the output onto one line or dropping -n would keep the formatting consistent. > + > +PHONY += auditconfig > +auditconfig: > + $(Q)if [ -z "$(POLICY)" ]; then \ > + echo >&2 "Usage: make POLICY=<profile> [OVERLAY=<overlay>] auditconfig"; \ > + $(list_auditconfig_rules); \ > + exit 2; \ > + fi > + $(Q)if ! $(auditconfig) list-policies | grep -qw "$(POLICY)"; then \ [Severity: Low] Should this use grep -Fxq -- "$(POLICY)" instead of grep -qw "$(POLICY)"? Without -F, -x, and --, regex metacharacters like POLICY=preempt.rt or leading-hyphen values like POLICY=--help bypass the Makefile check and fall through to audit.py or produce grep errors, and -w would also match a partial name if a policy stem contains a hyphen. > + echo >&2 "Unknown POLICY profile = $(POLICY)"; \ > + $(list_auditconfig_rules); \ > + exit 2; \ > + fi [Severity: Low] Does this pipeline mask audit.py startup and dependency failures? When PyYAML or jsonschema is missing, audit.py exits with os.EX_UNAVAILABLE and empty stdout, which POSIX sh hides behind grep's exit status. A valid POLICY is then misreported as unknown, $(list_auditconfig_rules) runs audit.py again glued onto "Available POLICY: ", and make exits 2. Capturing "$(auditconfig) list-policies" before checking POLICY (or letting audit.py validate POLICY directly) would preserve the failure. > + $(Q)$(auditconfig) check -c "$(KCONFIG_CONFIG)" -p "$(POLICY)" $(auditconfig_overlay) [Severity: Low] As reported by Nicolas Schier on v1 [1], is a top-level auditconfig make target needed for a standalone tools/ script that does not use Kbuild? Nicolas recommended keeping argument validation in the script and skipping Makefile integration so new CLI options do not need to be mapped here. audit.py already validates -p/--policy via argparse and adds -P/--policy-file and list-api-versions, which this wrapper omits. [1] https://lore.kernel.org/r/avQNfFbeoMImmtre@derry.ads.avm.de -- Sashiko AI review · https://sashiko.dev/#/patchset/20261203224916.118064-1-darwi@linutronix.de?part=10
Technical Details
Message-ID:
<O6KzE-g1p2-53@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!robomodReferences:
<O6o65-fPfD-3@gated-at.bofh.it> <O6o65-fPfD-17@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 10/11] kconfig: Introduce auditconfig target Date: Sat, 05 Dec 2026 00:10:02 +0100 Message-ID: <O6KzE-g1p2-53@gated-at.bofh.it> References: <O6o65-fPfD-3@gated-at.bofh.it> <O6o65-fPfD-17@gated-at.bofh.it> X-Mailbox-Line: From debian-kernel-request@lists.debian.org Fri Dec 4 23:07:26 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:hard: -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/158756 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-250781@kernel.org Approved: robomod@news.nic.it Lines: 112 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:19 +0000 X-Original-Message-ID: <sashiko-outbox-250781@kernel.org> X-Original-References: <20261203224916.118064-1-darwi@linutronix.de> <20261203224916.118064-11-darwi@linutronix.de>