Skip to contentSkip to conversation

ima: make ASYMMETRIC_PUBLIC_KEY_SUBTYPE 'bool'

PATCH In review Arnd Bergmann 2 participants 3 messages Jan 7, 2020

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

PATCH 1/1 ima: make ASYMMETRIC_PUBLIC_KEY_SUBTYPE 'bool'

The asymmetric key subtype is only used by the key subsystem that cannot itself be a loadable module, so when ASYMMETRIC_PUBLIC_KEY_SUBTYPE is set to =m, it just does not get used. It also produces a compile-time warning:

WARNING: modpost: missing MODULE_LICENSE() in security/integrity/ima/ima_asymmetric_keys.o

Make this a 'bool' symbol to avoid both problems.

Fixes 88e70da170e8 ("IMA: Define an IMA hook to measure keys")
---
 crypto/asymmetric_keys/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/asymmetric_keys/Kconfig +1 -1
index 1f1f004dc757..f2846293e4d5 100644
@@ -11,7 +11,7 @@ menuconfig ASYMMETRIC_KEY_TYPE
 if ASYMMETRIC_KEY_TYPE
 
 config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
-	tristate "Asymmetric public-key crypto algorithm subtype"
+	bool "Asymmetric public-key crypto algorithm subtype"
 	select MPILIB
 	select CRYPTO_HASH_INFO
 	select CRYPTO_AKCIPHER
Signature · 1 line
2.20.0
#1 lore raw
Quoted 23 lines · Arnd Bergmann

The asymmetric key subtype is only used by the key subsystem that cannot itself be a loadable module, so when ASYMMETRIC_PUBLIC_KEY_SUBTYPE is set to =m, it just does not get used. It also produces a compile-time
warning:

WARNING: modpost: missing MODULE_LICENSE() in
security/integrity/ima/ima_asymmetric_keys.o

Make this a 'bool' symbol to avoid both problems.

Fixes 88e70da170e8 ("IMA: Define an IMA hook to measure keys")
---
 crypto/asymmetric_keys/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/asymmetric_keys/Kconfig +0 -0
index 1f1f004dc757..f2846293e4d5 100644

crypto/asymmetric_keys/Kconfig menuconfig ASYMMETRIC_KEY_TYPE · line 14

Quoted 5 lines
crypto/asymmetric_keys/Kconfig +1 -1
@@ -11,7 +11,7 @@ menuconfig ASYMMETRIC_KEY_TYPE
 if ASYMMETRIC_KEY_TYPE
 
 config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
-	tristate "Asymmetric public-key crypto algorithm subtype"
+	bool "Asymmetric public-key crypto algorithm subtype"

I believe the crypto guys do like stuff to be modular.

However, we've already implemented this solution:

https://lore.kernel.org/linux-integrity/[email protected]/

To solve the problem via an intermediate boolean config variable.

James

#2 lore raw
Quoted 7 lines · James Bottomley

crypto/asymmetric_keys/Kconfig menuconfig ASYMMETRIC_KEY_TYPE · line 14

Quoted 3 lines · Arnd Bergmann

config ASYMMETRIC_PUBLIC_KEY_SUBTYPE

crypto/asymmetric_keys/Kconfig +1 -1
-     tristate "Asymmetric public-key crypto algorithm subtype"
+     bool "Asymmetric public-key crypto algorithm subtype"
Quoted 7 lines

I believe the crypto guys do like stuff to be modular.

However, we've already implemented this solution:

https://lore.kernel.org/linux-integrity/[email protected]/

To solve the problem via an intermediate boolean config variable.

Ok, that looks good to me.

Arnd