Skip to content

Commit 781a573

Browse files
naynajainmimizohar
authored andcommitted
ima: ensure IMA_APPRAISE_MODSIG has necessary dependencies
IMA_APPRAISE_MODSIG is used for verifying the integrity of both kernel and modules. Enabling IMA_APPRAISE_MODSIG without MODULES causes a build break. Ensure the build time kernel signing key is only generated if both IMA_APPRAISE_MODSIG and MODULES are enabled. Fixes: 0165f4c ("ima: enable signing of modules with build time generated key") Reported-by: Randy Dunlap <[email protected]> Reported-by: Stephen Rothwell <[email protected]> Acked-by: Randy Dunlap <[email protected]> # build-tested Signed-off-by: Nayna Jain <[email protected]> Signed-off-by: Mimi Zohar <[email protected]>
1 parent 28073eb commit 781a573

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

certs/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ menu "Certificates for signature checking"
44
config MODULE_SIG_KEY
55
string "File name or PKCS#11 URI of module signing key"
66
default "certs/signing_key.pem"
7-
depends on MODULE_SIG || IMA_APPRAISE_MODSIG
7+
depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
88
help
99
Provide the file name of a private key/certificate in PEM format,
1010
or a PKCS#11 URI according to RFC7512. The file should contain, or

certs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ ifeq ($(CONFIG_MODULE_SIG),y)
3636
endif
3737

3838
ifeq ($(CONFIG_IMA_APPRAISE_MODSIG),y)
39+
ifeq ($(CONFIG_MODULES),y)
3940
SIGN_KEY = y
4041
endif
42+
endif
4143

4244
ifdef SIGN_KEY
4345
###############################################################################

certs/system_certificates.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
system_certificate_list:
1010
__cert_list_start:
1111
__module_cert_start:
12-
#if defined(CONFIG_MODULE_SIG) || defined(CONFIG_IMA_APPRAISE_MODSIG)
12+
#if defined(CONFIG_MODULE_SIG) || (defined(CONFIG_IMA_APPRAISE_MODSIG) \
13+
&& defined(CONFIG_MODULES))
1314
.incbin "certs/signing_key.x509"
1415
#endif
1516
__module_cert_end:

0 commit comments

Comments
 (0)