diff options
Diffstat (limited to 'include/linux/module.h')
-rw-r--r-- | include/linux/module.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 2bb0c3085706..3daf2b3a09d2 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -330,6 +330,15 @@ struct mod_kallsyms { | |||
330 | char *strtab; | 330 | char *strtab; |
331 | }; | 331 | }; |
332 | 332 | ||
333 | #ifdef CONFIG_LIVEPATCH | ||
334 | struct klp_modinfo { | ||
335 | Elf_Ehdr hdr; | ||
336 | Elf_Shdr *sechdrs; | ||
337 | char *secstrings; | ||
338 | unsigned int symndx; | ||
339 | }; | ||
340 | #endif | ||
341 | |||
333 | struct module { | 342 | struct module { |
334 | enum module_state state; | 343 | enum module_state state; |
335 | 344 | ||
@@ -456,7 +465,11 @@ struct module { | |||
456 | #endif | 465 | #endif |
457 | 466 | ||
458 | #ifdef CONFIG_LIVEPATCH | 467 | #ifdef CONFIG_LIVEPATCH |
468 | bool klp; /* Is this a livepatch module? */ | ||
459 | bool klp_alive; | 469 | bool klp_alive; |
470 | |||
471 | /* Elf information */ | ||
472 | struct klp_modinfo *klp_info; | ||
460 | #endif | 473 | #endif |
461 | 474 | ||
462 | #ifdef CONFIG_MODULE_UNLOAD | 475 | #ifdef CONFIG_MODULE_UNLOAD |
@@ -630,6 +643,18 @@ static inline bool module_requested_async_probing(struct module *module) | |||
630 | return module && module->async_probe_requested; | 643 | return module && module->async_probe_requested; |
631 | } | 644 | } |
632 | 645 | ||
646 | #ifdef CONFIG_LIVEPATCH | ||
647 | static inline bool is_livepatch_module(struct module *mod) | ||
648 | { | ||
649 | return mod->klp; | ||
650 | } | ||
651 | #else /* !CONFIG_LIVEPATCH */ | ||
652 | static inline bool is_livepatch_module(struct module *mod) | ||
653 | { | ||
654 | return false; | ||
655 | } | ||
656 | #endif /* CONFIG_LIVEPATCH */ | ||
657 | |||
633 | #else /* !CONFIG_MODULES... */ | 658 | #else /* !CONFIG_MODULES... */ |
634 | 659 | ||
635 | /* Given an address, look for it in the exception tables. */ | 660 | /* Given an address, look for it in the exception tables. */ |