From: Russell Currey <ruscur@russell.cc>
To: Christophe Leroy <christophe.leroy@c-s.fr>,
linuxppc-dev@lists.ozlabs.org
Cc: Julia.Lawall@lip6.fr, rashmica.g@gmail.com
Subject: Re: [PATCH 2/2] powerpc/mm: Warn if W+X pages found on boot
Date: Wed, 01 May 2019 17:04:42 +1000 [thread overview]
Message-ID: <ca5e1db5fca5c12ca69d7810d575a437ae39ec87.camel@russell.cc> (raw)
In-Reply-To: <8e659a8f-af3f-e889-3f7a-560178c1f7b1@c-s.fr>
On Wed, 2019-04-24 at 09:14 +0200, Christophe Leroy wrote:
>
> Le 24/04/2019 à 08:39, Russell Currey a écrit :
> > 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>
> > ---
> > arch/powerpc/Kconfig.debug | 19 +++++++++++++++
> > arch/powerpc/include/asm/pgtable.h | 5 ++++
> > arch/powerpc/mm/pgtable_32.c | 5 ++++
> > arch/powerpc/mm/pgtable_64.c | 5 ++++
> > arch/powerpc/mm/ptdump/ptdump.c | 38
> > ++++++++++++++++++++++++++++++
> > 5 files changed, 72 insertions(+)
> >
> > diff --git a/arch/powerpc/Kconfig.debug
> > b/arch/powerpc/Kconfig.debug
> > index 4e00cb0a5464..a4160ff02ed4 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 DEBUG_WX
>
> I would call it PPC_DEBUG_WX to avoid confusion.
It's the same functionality as on other architectures and is an arch-
local thing, I personally think it should be left as-is but given we
already put the PPC prefix on PTDUMP, I'll add it so it's consistent
<snip>
> > + if (radix_enabled())
> > + st.start_address = PAGE_OFFSET;
> > + else
> + st.start_address = KERN_VIRT_START;
>
> KERN_VIRT_START doesn't exist on PPC32.
>
> Christophe
>
Thanks a lot for the review! Applied all your suggestions. What
should I use on PPC32 instead?
- Russell
next prev parent reply other threads:[~2019-05-01 7:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-24 6:39 [PATCH 1/2] powerpc/mm/ptdump: Wrap seq_printf() to handle NULL pointers Russell Currey
2019-04-24 6:39 ` [PATCH 2/2] powerpc/mm: Warn if W+X pages found on boot Russell Currey
2019-04-24 7:14 ` Christophe Leroy
2019-05-01 7:04 ` Russell Currey [this message]
2019-05-02 5:23 ` Christophe Leroy
2019-05-02 5:51 ` Russell Currey
2019-08-09 13:11 ` Christophe Leroy
2019-04-24 6:56 ` [PATCH 1/2] powerpc/mm/ptdump: Wrap seq_printf() to handle NULL pointers Christophe Leroy
2019-04-24 7:00 ` Russell Currey
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=ca5e1db5fca5c12ca69d7810d575a437ae39ec87.camel@russell.cc \
--to=ruscur@russell.cc \
--cc=Julia.Lawall@lip6.fr \
--cc=christophe.leroy@c-s.fr \
--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