History

ima: Fix undefined arch_ima_get_secureboot() and co

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.

Takashi Iwai committed 4 years ago

Commit 54bf7fa1 parent 13605721 file · +15 −15Browse files

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/linux/ima.h+15−15
@@ -50,21 +50,6 @@ static inline void ima_appraise_parse_cmdline(void) {} · 49 unmodified lines
5050 extern void ima_add_kexec_buffer(struct kimage *image);
5151 #endif
5252
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−
6853 #else
6954 static inline enum hash_algo ima_get_current_hash_algo(void)
7055 {
@@ -155,6 +140,21 @@ static inline int ima_measure_critical_data(const char *event_label, · 84 unmodified lines
155140
156141 #endif /* CONFIG_IMA */
157142
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+
158158 #ifndef CONFIG_IMA_KEXEC
159159 struct kimage;
160160

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t