From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=84.16.66.168 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796162472; b=abFRTIM/pjR3ryIBC2kWa1m78gUzXHs6udZ8fpPsl/j8y98m4x4Nhpqn0c1XjX5KJJiG phX2vIuD/vwABBs4I8c+JZN+NxRrudj6OzwZhz4fZ5hxnAiyQdtMM1byA+a75SqXYaMwF XlgMiIK4pvBt619X/C/wSE5HZv6u0wMsjG1Am9+mU7JmsPwS6QKfr17N4505Xye2IMdOQ /Nsy3xzjU3Yr3lPRPLRuvSWKvZn7yjjaM81k1n2HZJwomtsqUZFaUJCKEv3WBMmALrsZX MJXBEij6ySdl5sgCeVvVjSugRKQH2liljXx9MuLiMi7+Ruq0IPOrb2m75v5tnlJYmmg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796162472; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding:X-Infomaniak-Routing; bh=y0EFAZRoXte6kjXNPRqZdWOsgRZKcmysyAUS6plNcCQ=; b=X3DoxRQn++cId+gi/YrKw51RFYSSBwUQiXxg7r0kJmdT5QHFCfZ4hm7x3Jr6F0PKj7xA fCGTpPLpJNqXnF1Nu522n51onDNwcAwiHD5uUZItfYyn8VYt6rUAlp3YS5Wuzw+G/iXEe 7caQKP1Ih3F0IuEf8c0jpbPCRpdrcWt3R6H+0lw0grUAF67u7IXbia6CuyGqp4cPqMPAx kiBwDrXxM415yLjwhzPtBuDRvgiFtGpnDzD6XNYcIiHHqRZHUlsrXqTAFQlAZP7PT5BH1 aZWGoKMfKSA0+mAUkvJ9SfIb2x5c94n4lMAQ0lhdhk1PJ6as16CujfF7Y70N+OxLoKw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=daylightlinux.ch; spf=pass smtp.mailfrom=daylightlinux.ch; dkim=pass header.d=daylightlinux.ch header.i=@daylightlinux.ch header.a=rsa-sha256 header.s=20261016 header.b=Wzvoqvla; arc=none smtp.remote-ip=84.16.66.168 Received: from smtp-42a8.mail.infomaniak.ch (smtp-42a8.mail.infomaniak.ch [84.16.66.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01141606A32A for ; Tue, 1 Dec 2026 22:01:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 01141606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=daylightlinux.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=daylightlinux.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=daylightlinux.ch header.i=@daylightlinux.ch header.a=rsa-sha256 header.s=20261016 header.b=Wzvoqvla Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000 (Postfix) with ESMTPS id 4jfFFr2Q14zhjJ; Tue, 1 Dec 2026 23:01:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daylightlinux.ch; s=20261016; t=1796162464; bh=y0EFAZRoXte6kjXNPRqZdWOsgRZKcmysyAUS6plNcCQ=; h=From:To:Cc:Subject:Date:From; b=WzvoqvlaZ0m3ck+2dGAX8/30FsfuNqxT1O+J9Vgwmht+JLC6SvDraH/1pFokik0cr R/9tpU97yp7Ozldp9YDfa6v2imFDBe0PzxdOqnIICWtkCDw/4D6hqByt6oglEZJer+ axgLLRN5l2yEd+fRR9SJwnfXxJtS6ZDsUpnm3GYqKDDgfli7QBWS5Ox0XC427EPXwT 5Z4wKRV1oblZaAEwkWULXHa3gbiD9Vp/Z2h7Gm52bgn/OFnFvKUHTC52RSncSAWMj2 p7Axo6Oz3SRKx2u8SfZKfnGxJRVnnB2H6QTP132KMAt6SnZ4C9dKzat10nM53DWBjT xHpOkEivl0zHw== Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4jfFFq2Sngzj1b; Tue, 1 Dec 2026 23:01:03 +0100 (CET) Received: from unknown by raspberrypi.home with local (Exim 4.96) (envelope-from ) id 1xYVuI-004jz0-34; Tue, 01 Dec 2026 23:01:02 +0100 From: Hamdy Abou El Anein To: nathan@kernel.org, nsc@kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, irogers@google.com, tglx@kernel.org, peterz@infradead.org Subject: [PATCH] kbuild: reject nonzero checker exit status in checker-valid.sh Date: Tue, 1 Dec 2026 23:00:57 +0100 Message-ID: <20261201220057.12323-1-info@daylightlinux.ch> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha The checker validation script only examines the output for the word "error". If the checker fails without printing that word, the pipeline still reports 1, and Kbuild treats the checker as functional. Check the invocation's exit status before scanning its output. Retain the existing output check because sparse can return zero on error. Tested using a mock checker that succeeds, fails silently, fails with a diagnostic, or reports an error while returning zero. Also verified that a missing checker is still rejected. AI assistance: ChatGPT identified the bug by inspecting the script and prepared the fix, commit message and local regression tests. Fixes: fd69b2f7d5f4 ("compiler: Use __typeof_unqual__() for __unqual_scalar_typeof()") Signed-off-by: Hamdy Abou El Anein --- scripts/checker-valid.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/checker-valid.sh b/scripts/checker-valid.sh index 625a789ed1c8..38defc32cbd9 100755 --- a/scripts/checker-valid.sh +++ b/scripts/checker-valid.sh @@ -14,6 +14,10 @@ static inline int u(const int *q) } EOF -# sparse happily exits with 0 on error so validate -# there is none on stderr. Use awk as grep is a pain with sh -e -$@ $tmp_file 2>&1 | awk -v c=1 '/error/{c=0}END{print c}' +# Reject a failed checker invocation even if it prints no error. +# sparse may also exit with 0 on error, so inspect its output. +if output=$("$@" "$tmp_file" 2>&1); then + printf '%s\n' "$output" | awk -v c=1 '/error/{c=0}END{print c}' +else + echo 0 +fi -- 2.56.1