[PATCH v2 2/2] powerpc/mm: Warn if W+X pages found on boot
Russell Currey
ruscur at russell.cc
Fri May 3 10:55:13 AEST 2019
On Fri, 2019-05-03 at 00:37 +0000, Joel Stanley wrote:
> On Thu, 2 May 2019 at 07:42, Russell Currey <ruscur at russell.cc>
> wrote:
> > 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 at russell.cc>
> > ---
> > v2: A myriad of fixes and cleanups thanks to Christophe Leroy
> >
> > arch/powerpc/Kconfig.debug | 19 ++++++++++++++
> > arch/powerpc/include/asm/pgtable.h | 6 +++++
> > arch/powerpc/mm/pgtable_32.c | 3 +++
> > arch/powerpc/mm/pgtable_64.c | 3 +++
> > arch/powerpc/mm/ptdump/ptdump.c | 41
> > +++++++++++++++++++++++++++++-
> > 5 files changed, 71 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/powerpc/Kconfig.debug
> > b/arch/powerpc/Kconfig.debug
> > index 4e00cb0a5464..9e8bcddd8b8f 100644
> > --- a/arch/powerpc/Kconfig.debug
> > +++ b/arch/powerpc/Kconfig.debug
> > @@ -361,6 +361,25 @@ config PPC_PTDUMP
> >
> > If you are unsure, say N.
> >
> > +config PPC_DEBUG_WX
>
> The other architectures call this DEBUG_WX, in case you wanted to
> name
> it the same.
I did originally, I changed it since we have PPC_PTDUMP but I don't
really care either way. mpe can change it if he wants
>
> > + bool "Warn on W+X mappings at boot"
> > + select PPC_PTDUMP
> > + help
> > + Generate a warning if any W+X mappings are found at boot.
More information about the Linuxppc-dev
mailing list