diff options
| author | Mikhail Malyshev <mike.malyshev@gmail.com> | 2025-10-15 19:34:52 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-01-11 17:18:40 +0300 |
| commit | 614b89e41bdf01858374b1b365e02bdbb0ceb7c3 (patch) | |
| tree | 63c899a186833e01e5b05d6cbe9447ec0b899417 /scripts/Makefile.modinst | |
| parent | 85a991ed8d958341eda0c63a4c4c175d45fa4597 (diff) | |
| download | linux-614b89e41bdf01858374b1b365e02bdbb0ceb7c3.tar.xz | |
kbuild: Use objtree for module signing key path
[ 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 <mike.malyshev@gmail.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20251015163452.3754286-1-mike.malyshev@gmail.com
Signed-off-by: Nicolas Schier <nsc@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts/Makefile.modinst')
| -rw-r--r-- | scripts/Makefile.modinst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 10df89b9ef67..dc947e7872b9 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -67,7 +67,7 @@ endif # ifeq ($(CONFIG_MODULE_SIG_ALL),y) 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 |
