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 8F42135A3AD; Mon, 4 May 2026 14:23:11 +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=1777904591; cv=none; b=EdcF/AS/9pB6RoiLrI2CSbl20WBIT0bDQ/j3YwcWXSE+GAaPvVfMZDMGj0LIy5r7ezW2P29k17y2id1W5TXsJjVAGimyvfTBFl8d01XPi7qMUqatr+fCYRsCIg+M1GDrnWdZVnsUuG0r7w89Gn4haBmTx0fPoJd7nzenuZQLoQ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777904591; c=relaxed/simple; bh=g6ulV161g5RbTOS0q/o4JsjFSbT1iAkeMIaQJMD/A/E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=saqnOqQnXEM8qMKJ0ij7F8e0t9cRS+libdvHvoCD+qgrqBiNLA6fhyWuc7U3TbU2/eHbo5Tt3TX8RbQuYIeznPTht8tmvZ7BCIUXbqLvTzjHafYGUUBBroUtdOxwC8PO3kDUI+VfBeU/vZulTkL5ykKUXfvW3t2cEh+cdQDD9d4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=a+/fiLBY; 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="a+/fiLBY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25432C2BCB8; Mon, 4 May 2026 14:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777904591; bh=g6ulV161g5RbTOS0q/o4JsjFSbT1iAkeMIaQJMD/A/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a+/fiLBYXoDSeBu5LcONVtr14nwohKnak0GfJ3ZAVG2Dur0xT8qcWr+M0X53r0cgF k35AYBDJ7TfBkJDr0il6wF7hJZGDX2dJEcMG40uYCGyVmEvk6ezOEsD8rvglwnouZz y061Y1OmiIyyedScQro6JaNTvWC7xt1Oz0JYuc2s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nick Desaulniers , Nathan Chancellor Subject: [PATCH 6.12 097/215] extract-cert: Wrap key_pass with #ifdef USE_PKCS11_ENGINE Date: Mon, 4 May 2026 15:51:56 +0200 Message-ID: <20260504135133.698943030@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504135130.169210693@linuxfoundation.org> References: <20260504135130.169210693@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.12-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();