diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2019-04-18 02:51:19 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-04-21 09:05:56 -0400 |
commit | 0fb1c25ab523614b056ace11be67aac8f8ccabb1 (patch) | |
tree | 0f458e2ca41b6e94626f1d7bc41c4557e42a44ec /arch/powerpc/mm/init-common.c | |
parent | 69795cabe4cfe5122438d50010ad5310c113a013 (diff) |
powerpc: Add skeleton for Kernel Userspace Execution Prevention
This patch adds a skeleton for Kernel Userspace Execution Prevention.
Then subarches implementing it have to define CONFIG_PPC_HAVE_KUEP
and provide setup_kuep() function.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: Don't split strings, use pr_crit_ratelimited()]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/init-common.c')
-rw-r--r-- | arch/powerpc/mm/init-common.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/mm/init-common.c b/arch/powerpc/mm/init-common.c index 36d28e872289..83f95a5565d6 100644 --- a/arch/powerpc/mm/init-common.c +++ b/arch/powerpc/mm/init-common.c | |||
@@ -26,8 +26,19 @@ | |||
26 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
27 | #include <asm/kup.h> | 27 | #include <asm/kup.h> |
28 | 28 | ||
29 | static bool disable_kuep = !IS_ENABLED(CONFIG_PPC_KUEP); | ||
30 | |||
31 | static int __init parse_nosmep(char *p) | ||
32 | { | ||
33 | disable_kuep = true; | ||
34 | pr_warn("Disabling Kernel Userspace Execution Prevention\n"); | ||
35 | return 0; | ||
36 | } | ||
37 | early_param("nosmep", parse_nosmep); | ||
38 | |||
29 | void __init setup_kup(void) | 39 | void __init setup_kup(void) |
30 | { | 40 | { |
41 | setup_kuep(disable_kuep); | ||
31 | } | 42 | } |
32 | 43 | ||
33 | #define CTOR(shift) static void ctor_##shift(void *addr) \ | 44 | #define CTOR(shift) static void ctor_##shift(void *addr) \ |