diff options
Diffstat (limited to 'arch/powerpc/mm/book3s32')
-rw-r--r-- | arch/powerpc/mm/book3s32/kuap.c | 6 | ||||
-rw-r--r-- | arch/powerpc/mm/book3s32/kuep.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/mm/book3s32/kuap.c b/arch/powerpc/mm/book3s32/kuap.c index 1df55392878e..5533ed92ab3d 100644 --- a/arch/powerpc/mm/book3s32/kuap.c +++ b/arch/powerpc/mm/book3s32/kuap.c @@ -1,9 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include <asm/kup.h> +#include <asm/smp.h> void __init setup_kuap(bool disabled) { + kuap_update_sr(mfsr(0) | SR_KS, 0, TASK_SIZE); + + if (smp_processor_id() != boot_cpuid) + return; + pr_info("Activating Kernel Userspace Access Protection\n"); if (disabled) diff --git a/arch/powerpc/mm/book3s32/kuep.c b/arch/powerpc/mm/book3s32/kuep.c index 919595f47e25..3147e2edcf63 100644 --- a/arch/powerpc/mm/book3s32/kuep.c +++ b/arch/powerpc/mm/book3s32/kuep.c @@ -1,9 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include <asm/kup.h> +#include <asm/smp.h> void __init setup_kuep(bool disabled) { + kuep_lock(); + + if (smp_processor_id() != boot_cpuid) + return; + pr_info("Activating Kernel Userspace Execution Prevention\n"); if (disabled) |