]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm: Warn if W+X pages found on boot
authorRussell Currey <ruscur@russell.cc>
Thu, 2 May 2019 07:39:47 +0000 (17:39 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 2 May 2019 16:54:45 +0000 (02:54 +1000)
commitd53b463794b1ea14f4bea062253473e0ad0c0084
treebc0424487d4f512ca6313ac84b03568784b19965
parent6a1668e17743766f4c014019b05af1817c0d1070
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>
arch/powerpc/Kconfig.debug
arch/powerpc/include/asm/pgtable.h
arch/powerpc/mm/pgtable_32.c
arch/powerpc/mm/pgtable_64.c
arch/powerpc/mm/ptdump/ptdump.c