From: Paul Mackerras <paulus@ozlabs.org>
To: Michael Neuling <mikey@neuling.org>
Cc: "Michal Suchánek" <msuchanek@suse.de>,
mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org,
"Haren Myneni" <haren@linux.vnet.ibm.com>,
"Nicholas Piggin" <npiggin@gmail.com>
Subject: Re: [PATCH] powerpc: Avoid code patching freed init sections
Date: Tue, 11 Sep 2018 08:38:06 +1000 [thread overview]
Message-ID: <20180910223806.GA25158@fergus> (raw)
In-Reply-To: <794308ed6aa6dcccf96e10bb0e3fa8d2dab9adff.camel@neuling.org>
On Mon, Sep 10, 2018 at 08:05:38PM +1000, Michael Neuling wrote:
>
> > > + /* Make sure we aren't patching a freed init section */
> > > + if (in_init_section(patch_addr) && init_freed())
> > > + return 0;
> > > +
> >
> > Do we even need the init_freed() check?
>
> Maybe not. If userspace isn't up, then maybe it's ok to skip.
Isn't this same function used for patching asm feature sections? It's
not OK to skip patching them in init code.
> > What user input can we process in init-only code?
>
> See the stack trace in the commit message. It's a weird case for KVM guests in
> KVM PR mode.
The fault_in_pages_readable (formerly __get_user) there isn't actually
reading userspace, it's just a way of doing a load with a convenient
way to handle it if it traps.
Paul.
prev parent reply other threads:[~2018-09-11 0:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 5:44 [PATCH] powerpc: Avoid code patching freed init sections Michael Neuling
2018-09-10 8:10 ` Michal Suchánek
2018-09-10 10:01 ` Michael Neuling
2018-09-10 9:54 ` Michal Suchánek
2018-09-10 10:05 ` Michael Neuling
2018-09-10 10:16 ` Christophe LEROY
2018-09-10 10:44 ` Michal Suchánek
2018-09-10 22:38 ` Paul Mackerras [this message]
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=20180910223806.GA25158@fergus \
--to=paulus@ozlabs.org \
--cc=haren@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=npiggin@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).