As a result of the asymmetric public keys subtype Kconfig option being defined as tristate, with the existing IMA Makefile, ima_asymmetric_keys.c could be built as a kernel module. To prevent this from happening, this patch defines and uses an intermediate Kconfig boolean option named IMA_MEASURE_ASYMMETRIC_KEYS.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -101,7 +101,7 @@ static inline void ima_add_kexec_buffer(struct kimage *image) · 100 unmodified lines | ||
| 101 | 101 | {} |
| 102 | 102 | #endif |
| 103 | 103 | |
| 104 | −#if defined(CONFIG_IMA) && defined(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE) | |
| 104 | +#ifdef CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS | |
| 105 | 105 | extern void ima_post_key_create_or_update(struct key *keyring, |
| 106 | 106 | struct key *key, |
| 107 | 107 | const void *payload, size_t plen, |
| @@ -113,7 +113,7 @@ static inline void ima_post_key_create_or_update(struct key *keyring, · 5 unmodified lines | ||
| 113 | 113 | size_t plen, |
| 114 | 114 | unsigned long flags, |
| 115 | 115 | bool create) {} |
| 116 | −#endif /* CONFIG_IMA && CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE */ | |
| 116 | +#endif /* CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS */ | |
| 117 | 117 | |
| 118 | 118 | #ifdef CONFIG_IMA_APPRAISE |
| 119 | 119 | extern bool is_ima_appraise_enabled(void); |