hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/moduleloader.h
....@@ -29,6 +29,21 @@
2929 /* Free memory returned from module_alloc. */
3030 void module_memfree(void *module_region);
3131
32
+/* Determines if the section name is an init section (that is only used during
33
+ * module loading).
34
+ */
35
+bool module_init_section(const char *name);
36
+
37
+/* Determines if the section name is an exit section (that is only used during
38
+ * module unloading)
39
+ */
40
+bool module_exit_section(const char *name);
41
+
42
+/* Describes whether within_module_init() will consider this an init section
43
+ * or not. This behaviour changes with CONFIG_MODULE_UNLOAD.
44
+ */
45
+bool module_init_layout_section(const char *sname);
46
+
3247 /*
3348 * Apply the given relocation to the (simplified) ELF. Return -error
3449 * or 0.
....@@ -86,7 +101,8 @@
86101 /* Any cleanup before freeing mod->module_init */
87102 void module_arch_freeing_init(struct module *mod);
88103
89
-#ifdef CONFIG_KASAN
104
+#if (defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)) && \
105
+ !defined(CONFIG_KASAN_VMALLOC)
90106 #include <linux/kasan.h>
91107 #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT)
92108 #else