From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796424620; b=Mp0QgNnsXr1lPvVUMTg2bwQPPK4nMso0LxvNYvBLpQm7m9JmoFg3hesSpfX8hFKmhjUE EMS0b/mzW/jc5IsrctGBM1PDilfqSJT//10sR8RYqG84wAmouQJOK8Tk/Ed+PWJeJxDeC Gm06O3/KaDZBVDpiefcRALT/hgHAG9xqcKIn+aZQOaiPCaJFPF0K5ddpzFSr3Wcdmxe/G l/w5d8GUxmDeAVlUOHIf2gpf4fetBM4du8Hp5cvGFMb72PG6Gq50ig8MUSrHrloAyUCdu YwTJTp+KjHzRUfzB8PMDZB/b4yEXSB3jyEXkn0J5EgqsMVNpB+ghJppSJE99x32SoYg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796424620; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Qvg/phCuuaODQtkfNb2PpiwjpEkdVHlXc+a/RqqxWAk=; b=GsrbfhakQux0X2e5ftyGvMR9fjqo+C3RyJgW6ceOqnqRIa6JJabd4hWWFoo9F24iacxw Mlc8NRIJxRhNxe1PuVIVfNN4RPL564ACgloHgTOx7HC0SbMrO9m9/eg+nrX7dno/hINVZ E8SsHAkgYzqWY0WAQUniLA5RfFvFc46GyoDpkpf+I0NLgsRFoq3S9BoKIVCxvS0H7f37M lYynKiKfAPHbRykdPRJ8dCn3dE5xUUwgvKY5flFznSPbtM2ng5sPl93P/l2M+5mY6LQsj Ykx9/he5XlqHzF9hOlK3zCbX/nF6uuyFUb6rUm2qoEQ/JL/WbhP/ESkQ0XhfKxXdzDQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZEGs8SQO; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB0B4606A33B; Fri, 4 Dec 2026 22:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZEGs8SQO Received: by smtp.kernel.org (Postfix) with ESMTPSA id A29061F00A10; Fri, 4 Dec 2026 22:50:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796424620; bh=Qvg/phCuuaODQtkfNb2PpiwjpEkdVHlXc+a/RqqxWAk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ZEGs8SQO4zHJPsi4gDEZf6GPThebxSQYcvEbmC3RgYsVy5vb6vbWQoPDkODio/mHd 1cZxBNfjtRP9GwIfrWNJOaqYA8a5HZ9i9HzLFlEHFeCaC3gpCQ2nFwrOAlc1VtYv64 bUubXhVUPpq+ya7Rivy/De2XggXvL7nO+R79grIi04cEdGkLtAuXT3qTumNB0mSks5 QLCVj5lTHCHmsITzPO6G/Ndm/ydoQLeUMMY5eTKexBLetQqfPTzlrBsd+Q8HdLz7i2 AQBKSArk1jeG7aSedB2KWlFEZaABh83R7aF4m6U79aSwAtU6YaUm0gaP3TUZIJg/Xv fnfKqjaqhRvPw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 10/11] kconfig: Introduce auditconfig target Reply-To: sashiko-reviews@lists.linux.dev To: "Ahmed S. Darwish" , "Nathan Chancellor" , "Nicolas Schier" , "Julian Braha" , "Emanuele Rocca" , "Clark Williams" , "Steven Rostedt" , "Ingo Molnar" Cc: "Sebastian Andrzej Siewior" , "Frederic Weisbecker" , "John Ogness" , "Derek Barbosa" , =?utf-8?b?WmJpZ25pZXcgSsSZZHJ6ZWpld3Nr?= =?utf-8?b?aS1Tem1law==?= , "Daan De Meyer" , "Luca Boccassi" , linux-rt-devel@lists.linux.dev, debian-kernel@lists.debian.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20261203224916.118064-11-darwi@linutronix.de> References: <20261203224916.118064-1-darwi@linutronix.de> <20261203224916.118064-11-darwi@linutronix.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 22:50:19 +0000 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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=3D 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 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=3Dno) > clean-files +=3D tests/.cache > =20 > +auditconfig :=3D $(PYTHON3) -B $(srctree)/tools/kconfig-audit/audit.py > +auditconfig_overlay =3D $(if $(OVERLAY),-o "$(OVERLAY)") [Severity: Low] Will a relative OVERLAY path work in out-of-tree O=3D 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=3Dmy-overlay.yml then fails with No such file or directory unless the file is inside the O=3D tre= e. Canonicalizing OVERLAY before changing directories or falling back to $(srctree)/$(OVERLAY) would handle this. > + > +list_auditconfig_rules =3D \ > + 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 +=3D auditconfig > +auditconfig: > + $(Q)if [ -z "$(POLICY)" ]; then \ > + echo >&2 "Usage: make POLICY=3D [OVERLAY=3D] auditco= nfig"; \ > + $(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=3Dpreempt.rt or leading-hyphen values like POLICY=3D--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 =3D $(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)" $(auditc= onfig_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 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203224916.1180= 64-1-darwi@linutronix.de?part=3D10