From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org, Russell Currey <ruscur@russell.cc>
Subject: Re: [PATCH v2] powerpc/powernv/idle: Restore IAMR after idle
Date: Thu, 28 Feb 2019 00:53:55 +1000 [thread overview]
Message-ID: <1551271665.t9k4qh3o3r.astroid@bobo.none> (raw)
In-Reply-To: <20190208111103.4901-1-ruscur@russell.cc>
Russell Currey's on February 8, 2019 9:11 pm:
> Without restoring the IAMR after idle, execution prevention on POWER9
> with Radix MMU is overwritten and the kernel can freely execute userspace without
> faulting.
>
> This is necessary when returning from any stop state that modifies user
> state, as well as hypervisor state.
>
> To test how this fails without this patch, load the lkdtm driver and
> do the following:
>
> echo EXEC_USERSPACE > /sys/kernel/debug/provoke-crash/DIRECT
>
> which won't fault, then boot the kernel with powersave=off, where it
> will fault. Applying this patch will fix this.
>
> Fixes: 3b10d0095a1e ("powerpc/mm/radix: Prevent kernel execution of user
> space")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Russell Currey <ruscur@russell.cc>
> ---
> Since v1:
> - no longer use paca to save IAMR, instead use _DAR (thanks mpe)
> - remove isync and pnv_wakeup_noloss section (thanks Nick)
Thanks for that, looks good.
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
next prev parent reply other threads:[~2019-02-27 14:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-08 11:11 [PATCH v2] powerpc/powernv/idle: Restore IAMR after idle Russell Currey
2019-02-27 12:06 ` Akshay Adiga
2019-02-27 14:53 ` Nicholas Piggin [this message]
2019-02-28 9:54 ` Gautham R Shenoy
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=1551271665.t9k4qh3o3r.astroid@bobo.none \
--to=npiggin@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ruscur@russell.cc \
/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).