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 65703359F98; Fri, 9 Jan 2026 12:03:12 +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=1767960192; cv=none; b=OSr31FS8J+hJ4FOaIukagbEsO3598+MK/5z/mN5YRDv80zOQBUHL21tSZ+B5Ol5xTpW5HNlHgRd2AsyjoC6yqF7PPqwtboKGdE6t15Tu9hBBdQBneSUAqycELpqaf3gN3pnLTznX5Ndh+HDqgvIc15bHotnmaAz9qnmFZbYOo34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767960192; c=relaxed/simple; bh=NmHApGR8+9V3afV5lPQJxmmrLiyqg6ZVNWXdU/e22So=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B5bvROlCVE/jk2d7V+UVu9uJTArk122WV2C6uMU2FZNO+pS0Z135p0zXKGs3hfzB3fEV9KSVJ/U9hnqIaThInrSNABIB3sYCxdJhuUAjnueI/JN2JMNii5MjnduKdnC99AbDHBQNA+wWYSBzfB8RR5Z44uL0OmfkiAS+qj5/mas= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Wun6kpRk; 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="Wun6kpRk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6DEBC4CEF1; Fri, 9 Jan 2026 12:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767960192; bh=NmHApGR8+9V3afV5lPQJxmmrLiyqg6ZVNWXdU/e22So=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wun6kpRkAIrpDKYuLejqRhXez9tdeIy1FhIMfhpGCgOTbkNfWDtn+nI50qbrf49M9 jYHY+qZiWDiTreCKvES7y71vokf/dF1I2wSFBb3jWXX88QfMQ0JHG9K8eP0/Q9+J5A a/EVI/ba7HAWQEhvVsY0Fd7PjwsLFETSpjumQvL0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikhail Malyshev , Nathan Chancellor , Nicolas Schier , Sasha Levin Subject: [PATCH 6.6 316/737] kbuild: Use objtree for module signing key path Date: Fri, 9 Jan 2026 12:37:35 +0100 Message-ID: <20260109112145.888904269@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112133.973195406@linuxfoundation.org> References: <20260109112133.973195406@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikhail Malyshev [ Upstream commit af61da281f52aba0c5b090bafb3a31c5739850ff ] When building out-of-tree modules with CONFIG_MODULE_SIG_FORCE=y, module signing fails because the private key path uses $(srctree) while the public key path uses $(objtree). Since signing keys are generated in the build directory during kernel compilation, both paths should use $(objtree) for consistency. This causes SSL errors like: SSL error:02001002:system library:fopen:No such file or directory sign-file: /kernel-src/certs/signing_key.pem The issue occurs because: - sig-key uses: $(srctree)/certs/signing_key.pem (source tree) - cmd_sign uses: $(objtree)/certs/signing_key.x509 (build tree) But both keys are generated in $(objtree) during the build. This complements commit 25ff08aa43e37 ("kbuild: Fix signing issue for external modules") which fixed the scripts path and public key path, but missed the private key path inconsistency. Fixes out-of-tree module signing for configurations with separate source and build directories (e.g., O=/kernel-out). Signed-off-by: Mikhail Malyshev Reviewed-by: Nathan Chancellor Tested-by: Nicolas Schier Link: https://patch.msgid.link/20251015163452.3754286-1-mike.malyshev@gmail.com Signed-off-by: Nicolas Schier Signed-off-by: Sasha Levin --- scripts/Makefile.modinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 0afd75472679f..3e8b069a04ff0 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -96,7 +96,7 @@ endif # Don't stop modules_install even if we can't sign external modules. # ifeq ($(filter pkcs11:%, $(CONFIG_MODULE_SIG_KEY)),) -sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(srctree)/)$(CONFIG_MODULE_SIG_KEY) +sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(objtree)/)$(CONFIG_MODULE_SIG_KEY) else sig-key := $(CONFIG_MODULE_SIG_KEY) endif -- 2.51.0