summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/pgtable_64.c
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2019-05-02 10:39:47 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2019-05-02 19:54:45 +0300
commit453d87f6a8aed827f5ebb1708a4cea458fd68d23 (patch)
treebc0424487d4f512ca6313ac84b03568784b19965 /arch/powerpc/mm/pgtable_64.c
parent5f18cbdbdd42b050c51eb9859f8ce43db3f51846 (diff)
downloadlinux-453d87f6a8aed827f5ebb1708a4cea458fd68d23.tar.xz
powerpc/mm: Warn if W+X pages found on boot
Implement code to walk all pages and warn if any are found to be both writable and executable. Depends on STRICT_KERNEL_RWX enabled, and is behind the DEBUG_WX config option. This only runs on boot and has no runtime performance implications. Very heavily influenced (and in some cases copied verbatim) from the ARM64 code written by Laura Abbott (thanks!), since our ptdump infrastructure is similar. Signed-off-by: Russell Currey <ruscur@russell.cc> [mpe: Fixup build error when disabled] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/pgtable_64.c')
-rw-r--r--arch/powerpc/mm/pgtable_64.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 4c6a73782b19..d2d976ff8a0e 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -332,6 +332,9 @@ void mark_rodata_ro(void)
radix__mark_rodata_ro();
else
hash__mark_rodata_ro();
+
+ // mark_initmem_nx() should have already run by now
+ ptdump_check_wx();
}
void mark_initmem_nx(void)