From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.125.25.9 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796162472; b=4wagUBuaySu/U/tJ9gGP6k5U85EaaepUfiO/8gCqyOb+m9fFYkJyaEfNMIqB67/t4m2o a2Z75MqhQpVIpZk0jHsehHaskR4hlwIZuNNubMwiQdgTV90pTSi+72yNL6pvx7jFAKoPW ryyjBtPCxnCIhvi2JJ2Iu2mLHxhpvsXM7k8AN1dqLKpFEyksqvan+B2Cq3opELdghJwXI MrZ+lx/evrSDRiKWR63/+fiP/+mUl0hSaapAGWPEYYsHIR5Jbe2DBxsFE/r83yABQXYM/ jHsyYSAncsd5tDhMKsFkB3ouaK75Bg+oJ9PXud9eO8eqD0e0dHnSbeGwq1fow188n8g== 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=S29vwbqct6vdFI08BhcRVo/p5r2Z5q0uwQVYMXETu/p62ZtaRuZR+6OaO+8uHEweBHzP LLb2nwWKCACgq7qzmodyNKDBQa7DE7eeKYiQTfjAO2M20MCtpWNqMz3yH4lp9RGl2DEzH T+dcWAg+QGPS+OP/0OFdzs/jaRrwZM6G38xbzxeNwi/ADTQfXOx0PZ6v2wl0GKCL86X73 RIiGFOYeEt0GPQouL2XY5oBJkq8ZRyHuQ3ZmcZ4bBIUTVwXyc76Cco1lztupbVy3QLLFT 5eUttKlb58LH/vIHjpvixQJoPXFPsz0S9aX7nYWTEibhDRdPm7K4BAP5C/5pPeUjAaw== 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=185.125.25.9 Received: from smtp-1909.mail.infomaniak.ch (smtp-1909.mail.infomaniak.ch [185.125.25.9]) (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 07CFE606A32D for ; Tue, 1 Dec 2026 22:01:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 07CFE606A32D 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-4-3000 (Postfix) with ESMTPS id 4jfFFr2VWZz16CG; 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-kernel@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