From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93A0A377575; Mon, 4 May 2026 14:12:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777903974; cv=none; b=M0AQHAYubZ2K8o9tApt6Lu9YEzV7AUrdy0Z38T+wJeoOzTCP9kpwvmi5QyUSl/OBMTnZUbEsJ/6+sO1vo6KKK9oypy4EnlxO+xDqRc0AxLN53ZBHB2y6aF4KPdBeLpvhj+vyZ9KmHT5T+AwrOz/Ir+cRmPBDI+rpwso/ySgDyzc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777903974; c=relaxed/simple; bh=XWxlyjbIHB4nk1/J3EQdjh4l82FImC53NmQt25OPFHs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AeOtJpJkpaFcLq/Ef33FrfJBlJj5q+lXfILcTHi0+9NoSyYBpq+STRRQcEvMpjWQFuHD6lYrNyo+E3pPtQT3tQ0J/H7X8XmcNIk8YgBMLpZRPpJNcJIu05OIANpZnKc1rggPy7Yxt91eTqMBHPJXKWnR2uk+DAWfpBisZS8WbtU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=U9x9MNyf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="U9x9MNyf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B0F8C2BCB8; Mon, 4 May 2026 14:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777903974; bh=XWxlyjbIHB4nk1/J3EQdjh4l82FImC53NmQt25OPFHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U9x9MNyfJugGkb107OwhhkSWHcrH6Ebq5c2PI5w/5zQRZSJmXAAOsIPo5CVfciLBd FWvWqJ0Z0D7bedQJaPCl8VZfcd5fQjevKeIpTu5fxkX4sP1++Nv/Iq9hM3s08yQY8m qQAffYNWfMRwCa9o/lsSbeXZaSD8wsKUOnKG2raY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nick Desaulniers , Nathan Chancellor Subject: [PATCH 6.18 135/275] extract-cert: Wrap key_pass with #ifdef USE_PKCS11_ENGINE Date: Mon, 4 May 2026 15:51:15 +0200 Message-ID: <20260504135147.921923050@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504135142.929052779@linuxfoundation.org> References: <20260504135142.929052779@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nathan Chancellor commit 4f96b7c68a9904e01049ef610d701b382dca9574 upstream. A recent strengthening of -Wunused-but-set-variable (enabled with -Wall) in clang under a new subwarning, -Wunused-but-set-global, points out an unused static global variable in certs/extract-cert.c: certs/extract-cert.c:46:20: error: variable 'key_pass' set but not used [-Werror,-Wunused-but-set-global] 46 | static const char *key_pass; | ^ After commit 558bdc45dfb2 ("sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3"), key_pass is only used with the OpenSSL engine API, not the new provider API. Wrap key_pass's declaration and assignment with '#ifdef USE_PKCS11_ENGINE' so that it is only included with its use to clear up the warning. While this is a little uglier than just marking key_pass with the unused attribute, this will make it easier to clean up all code associated with the use of the engine API if it were ever removed in the future. While in the area, use a tab for the key_pass assignment line to match the rest of the file. Cc: stable@vger.kernel.org Fixes: 558bdc45dfb2 ("sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3") Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Link: https://patch.msgid.link/20260325-certs-extract-cert-key_pass-unused-but-set-global-v1-1-ecf94326d532@kernel.org Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- certs/extract-cert.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/certs/extract-cert.c +++ b/certs/extract-cert.c @@ -43,7 +43,9 @@ void format(void) exit(2); } +#ifdef USE_PKCS11_ENGINE static const char *key_pass; +#endif static BIO *wb; static char *cert_dst; static bool verbose; @@ -135,7 +137,9 @@ int main(int argc, char **argv) if (verbose_env && strchr(verbose_env, '1')) verbose = true; - key_pass = getenv("KBUILD_SIGN_PIN"); +#ifdef USE_PKCS11_ENGINE + key_pass = getenv("KBUILD_SIGN_PIN"); +#endif if (argc != 3) format();