Currently arch_ima_get_secureboot() and arch_get_ima_policy() are defined only when CONFIG_IMA is set, and this makes any code calling those functions without CONFIG_IMA fail. Move the declaration and the dummy definition of those functions outside ifdef-CONFIG_IMA block for fixing the undefined symbols.
Showing the changes to include (1 of 1 file). Show all
Unified · Split
| @@ -50,21 +50,6 @@ static inline void ima_appraise_parse_cmdline(void) {} · 49 unmodified lines | |||
| 50 | extern void ima_add_kexec_buffer(struct kimage *image); | 50 | extern void ima_add_kexec_buffer(struct kimage *image); |
| 51 | #endif | 51 | #endif |
| 52 | 52 | ||
| 53 | #ifdef CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT | ||
| 54 | extern bool arch_ima_get_secureboot(void); | ||
| 55 | extern const char * const *arch_get_ima_policy(void); | ||
| 56 | #else | ||
| 57 | static inline bool arch_ima_get_secureboot(void) | ||
| 58 | { | ||
| 59 | return false; | ||
| 60 | } | ||
| 61 | |||
| 62 | static inline const char * const *arch_get_ima_policy(void) | ||
| 63 | { | ||
| 64 | return NULL; | ||
| 65 | } | ||
| 66 | #endif | ||
| 67 | |||
| 68 | #else | 53 | #else |
| 69 | static inline enum hash_algo ima_get_current_hash_algo(void) | 54 | static inline enum hash_algo ima_get_current_hash_algo(void) |
| 70 | { | 55 | { |
| @@ -155,6 +140,21 @@ static inline int ima_measure_critical_data(const char *event_label, · 84 unmodified lines | |||
| 155 | 140 | ||
| 156 | #endif /* CONFIG_IMA */ | 141 | #endif /* CONFIG_IMA */ |
| 157 | 142 | ||
| 143 | #ifdef CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT | ||
| 144 | extern bool arch_ima_get_secureboot(void); | ||
| 145 | extern const char * const *arch_get_ima_policy(void); | ||
| 146 | #else | ||
| 147 | static inline bool arch_ima_get_secureboot(void) | ||
| 148 | { | ||
| 149 | return false; | ||
| 150 | } | ||
| 151 | |||
| 152 | static inline const char * const *arch_get_ima_policy(void) | ||
| 153 | { | ||
| 154 | return NULL; | ||
| 155 | } | ||
| 156 | #endif | ||
| 157 | |||
| 158 | #ifndef CONFIG_IMA_KEXEC | 158 | #ifndef CONFIG_IMA_KEXEC |
| 159 | struct kimage; | 159 | struct kimage; |
| 160 | 160 | ||