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
50extern void ima_add_kexec_buffer(struct kimage *image);50extern void ima_add_kexec_buffer(struct kimage *image);
51#endif51#endif
52 52
53#ifdef CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT
54extern bool arch_ima_get_secureboot(void);
55extern const char * const *arch_get_ima_policy(void);
56#else
57static inline bool arch_ima_get_secureboot(void)
58{
59 return false;
60}
61
62static inline const char * const *arch_get_ima_policy(void)
63{
64 return NULL;
65}
66#endif
67
68#else53#else
69static inline enum hash_algo ima_get_current_hash_algo(void)54static 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
144extern bool arch_ima_get_secureboot(void);
145extern const char * const *arch_get_ima_policy(void);
146#else
147static inline bool arch_ima_get_secureboot(void)
148{
149 return false;
150}
151
152static inline const char * const *arch_get_ima_policy(void)
153{
154 return NULL;
155}
156#endif
157
158#ifndef CONFIG_IMA_KEXEC158#ifndef CONFIG_IMA_KEXEC
159struct kimage;159struct kimage;
160 160

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