Skip to contentSkip to conversation

ima: require CONFIG_MODULES for IMA_APPRAISE_MODSIG

PATCH In review Arnd Bergmann 2 participants 2 messages Apr 22, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ima: require CONFIG_MODULES for IMA_APPRAISE_MODSIG

From: Arnd Bergmann <[email protected]>

When module support is disabled, CONFIG_MODULE_SIG_HASH cannot be set either, so the build process fails with an error

certs/Makefile:52: *** Could not determine digest type to use from kernel config. Stop.

when IMA_APPRAISE_MODSIG is set but modules are not.

Add a Kconfig dependency to prevent this configuration.

Fixes 0165f4ca223b ("ima: enable signing of modules with build time generated key")
---
 security/integrity/ima/Kconfig | 1 +
 1 file changed, 1 insertion(+)
security/integrity/ima/Kconfig +1 -0
index 12e9250c1bec..2c36144cdd24 100644
@@ -242,6 +242,7 @@ config IMA_APPRAISE_MODSIG
 	bool "Support module-style signatures for appraisal"
 	depends on IMA_APPRAISE
 	depends on INTEGRITY_ASYMMETRIC_KEYS
+	depends on MODULES
 	select PKCS7_MESSAGE_PARSER
 	select MODULE_SIG_FORMAT
 	default n
Signature · 1 line
2.29.2
#1 lore raw
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When module support is disabled, CONFIG_MODULE_SIG_HASH cannot be set either, so the build process fails with an error

Quoted 8 lines

certs/Makefile:52: *** Could not determine digest type to use from kernel config. Stop.

when IMA_APPRAISE_MODSIG is set but modules are not.

Add a Kconfig dependency to prevent this configuration.

Fixes 0165f4ca223b ("ima: enable signing of modules with build time generated key")

Thanks Arnd !!

This fix solves the config issue, but adds an unnecessary MODULES dependency on APPRAISE_MODSIG. APPRAISE_MODSIG can be used for kernel image(appended signature) as well as for kernel modules.

I am working on the fix. I am sorry for the delay, I got stuck with some urgent issues early this week.

Thanks & Regards,

      - Nayna