Commit df415cd7 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/32s: Remove capability to disable KUEP at boottime

Disabling KUEP at boottime makes things unnecessarily complex.

Still allow disabling KUEP at build time, but when it's built-in
it is always there.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/96f583f82423a29a4205c60b9721079111b35567.1634627931.git.christophe.leroy@csgroup.eu
parent dc3a0e5b
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/jump_label.h> #include <linux/jump_label.h>
extern struct static_key_false disable_kuap_key; extern struct static_key_false disable_kuap_key;
extern struct static_key_false disable_kuep_key;
static __always_inline bool kuap_is_disabled(void) static __always_inline bool kuap_is_disabled(void)
{ {
...@@ -21,7 +20,7 @@ static __always_inline bool kuap_is_disabled(void) ...@@ -21,7 +20,7 @@ static __always_inline bool kuap_is_disabled(void)
static __always_inline bool kuep_is_disabled(void) static __always_inline bool kuep_is_disabled(void)
{ {
return !IS_ENABLED(CONFIG_PPC_KUEP) || static_branch_unlikely(&disable_kuep_key); return !IS_ENABLED(CONFIG_PPC_KUEP);
} }
static inline void kuep_lock(void) static inline void kuep_lock(void)
......
...@@ -3,18 +3,12 @@ ...@@ -3,18 +3,12 @@
#include <asm/kup.h> #include <asm/kup.h>
#include <asm/smp.h> #include <asm/smp.h>
struct static_key_false disable_kuep_key;
void setup_kuep(bool disabled) void setup_kuep(bool disabled)
{ {
if (!disabled)
kuep_lock(); kuep_lock();
if (smp_processor_id() != boot_cpuid) if (smp_processor_id() != boot_cpuid)
return; return;
if (disabled)
static_branch_enable(&disable_kuep_key);
else
pr_info("Activating Kernel Userspace Execution Prevention\n"); pr_info("Activating Kernel Userspace Execution Prevention\n");
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment