From: Russell Currey <ruscur@russell.cc>
To: Joel Stanley <joel@jms.id.au>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>,
Rashmica Gupta <rashmica.g@gmail.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 2/2] powerpc/mm: Warn if W+X pages found on boot
Date: Fri, 03 May 2019 10:55:13 +1000 [thread overview]
Message-ID: <5074405df506970edc7c3fe7604bc60f345163eb.camel@russell.cc> (raw)
In-Reply-To: <CACPK8XeGD85Yt1bZvuDo4LnYwn0xg15eDJoOep1JC3bg0s0uXA@mail.gmail.com>
On Fri, 2019-05-03 at 00:37 +0000, Joel Stanley wrote:
> On Thu, 2 May 2019 at 07:42, Russell Currey <ruscur@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@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.
next prev parent reply other threads:[~2019-05-03 0:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 7:39 [PATCH v2 1/2] powerpc/mm/ptdump: Wrap seq_printf() to handle NULL pointers Russell Currey
2019-05-02 7:39 ` [PATCH v2 2/2] powerpc/mm: Warn if W+X pages found on boot Russell Currey
2019-05-02 14:17 ` Michael Ellerman
2019-05-03 0:37 ` Joel Stanley
2019-05-03 0:55 ` Russell Currey [this message]
2020-01-06 10:10 ` Christophe Leroy
2019-05-03 6:59 ` [PATCH v2 1/2] powerpc/mm/ptdump: Wrap seq_printf() to handle NULL pointers Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5074405df506970edc7c3fe7604bc60f345163eb.camel@russell.cc \
--to=ruscur@russell.cc \
--cc=Julia.Lawall@lip6.fr \
--cc=joel@jms.id.au \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=rashmica.g@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).