diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2017-08-02 15:51:05 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-08-15 14:55:57 +0200 |
commit | 95902e6c8864d39b09134dcaa3c99d8161d1deea (patch) | |
tree | cb41417a8e6436b46a3b504fe73641b4234d5262 /arch/powerpc/mm/init_32.c | |
parent | powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32 (diff) | |
download | linux-95902e6c8864d39b09134dcaa3c99d8161d1deea.tar.xz linux-95902e6c8864d39b09134dcaa3c99d8161d1deea.zip |
powerpc/mm: Implement STRICT_KERNEL_RWX on PPC32
This patch implements STRICT_KERNEL_RWX on PPC32.
As for CONFIG_DEBUG_PAGEALLOC, it deactivates BAT and LTLB mappings
in order to allow page protection setup at the level of each page.
As BAT/LTLB mappings are deactivated, there might be a performance
impact.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/init_32.c')
-rw-r--r-- | arch/powerpc/mm/init_32.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c index 8a7c38b8d335..7d5fee1bb116 100644 --- a/arch/powerpc/mm/init_32.c +++ b/arch/powerpc/mm/init_32.c @@ -113,6 +113,12 @@ void __init MMU_setup(void) __map_without_bats = 1; __map_without_ltlbs = 1; } +#ifdef CONFIG_STRICT_KERNEL_RWX + if (rodata_enabled) { + __map_without_bats = 1; + __map_without_ltlbs = 1; + } +#endif } /* |