summaryrefslogtreecommitdiff
path: root/include/linux/moduleloader.h
diff options
context:
space:
mode:
authorAndrey Ryabinin <a.ryabinin@samsung.com>2015-03-12 16:26:14 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-03-12 18:46:08 -0700
commitd3733e5c98e952d419e77fa721912f09d15a2806 (patch)
treef5ada9a2bbdac2aedc64bd9d2dc112b7caa0e91d /include/linux/moduleloader.h
parenta5af5aa8b67dfdba36c853b70564fd2dfe73d478 (diff)
kasan, module: move MODULE_ALIGN macro into <linux/moduleloader.h>
include/linux/moduleloader.h is more suitable place for this macro. Also change alignment to PAGE_SIZE for CONFIG_KASAN=n as such alignment already assumed in several places. Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> Cc: Dmitry Vyukov <dvyukov@google.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/moduleloader.h')
-rw-r--r--include/linux/moduleloader.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
index f7556261fe3c..4d0cb9bba93e 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -84,4 +84,12 @@ void module_arch_cleanup(struct module *mod);
/* Any cleanup before freeing mod->module_init */
void module_arch_freeing_init(struct module *mod);
+
+#ifdef CONFIG_KASAN
+#include <linux/kasan.h>
+#define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT)
+#else
+#define MODULE_ALIGN PAGE_SIZE
+#endif
+
#endif