From: Masami Hiramatsu <mhiramat@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>, Ingo Molnar <mingo@redhat.com>,
"H . Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
"David S . Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -tip v3 0/2] kprobes/x86: Another way to make insn buffer RO and cleanup
Date: Mon, 28 Aug 2017 11:28:04 +0900 [thread overview]
Message-ID: <20170828112804.c7146d3246dfcf34a9671daf@kernel.org> (raw)
In-Reply-To: <150304456422.17009.11803713159528262211.stgit@devbox>
Hi Ingo,
What would you think about fixing this way?
This makes the instruction buffer always RO and
poke it via text_poke.
Thank you,
On Fri, 18 Aug 2017 17:22:54 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:
> Hi,
>
> This series modifies how to handle RO insn buffer and
> cleans up addressof operators.
>
> The 1st patch changes the RO insn buffer handling: instead
> of using set_memory_ro/rw to modify the buffer, it prepares
> new instructions in another buffer and write it with
> text_poke() as suggested by Ingo Molnar (Thanks!).
> Since the text_poke() is safely modifying code by
> mapping alias pages, it can write RO pages.
> This also override alloc_insn_page() so that it returns
> ROX page directly.
>
> The 2nd one is not changed. It is a cleanup patch
> to remove addressof operators ("&") since
> it is meaningless anymore.
>
> V3 has just a following update:
> - [1/2] Not to just add set_memory_ro(), introduce new
> patch to change the way to handle RO pages.
>
> Thanks,
>
> ---
>
> Masami Hiramatsu (2):
> kprobes/x86: Make insn buffer always ROX and use text_poke
> kprobes/x86: Remove addressof operators
>
>
> arch/x86/include/asm/kprobes.h | 4 +-
> arch/x86/kernel/kprobes/common.h | 6 ++-
> arch/x86/kernel/kprobes/core.c | 61 +++++++++++++++++++++------------
> arch/x86/kernel/kprobes/opt.c | 71 +++++++++++++++++++++-----------------
> kernel/kprobes.c | 2 +
> 5 files changed, 86 insertions(+), 58 deletions(-)
>
> --
> Masami Hiramatsu <mhiramat@kernel.org>
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2017-08-28 2:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 8:22 [PATCH -tip v3 0/2] kprobes/x86: Another way to make insn buffer RO and cleanup Masami Hiramatsu
2017-08-18 8:24 ` [PATCH -tip v3 1/2] kprobes/x86: Make insn buffer always ROX and use text_poke Masami Hiramatsu
2017-09-28 10:51 ` [tip:perf/core] kprobes/x86: Make insn buffer always ROX and use text_poke() tip-bot for Masami Hiramatsu
2017-08-18 8:25 ` [PATCH -tip v3 2/2] kprobes/x86: Remove addressof operators Masami Hiramatsu
2017-09-28 10:52 ` [tip:perf/core] kprobes/x86: Remove addressof() operators tip-bot for Masami Hiramatsu
2017-08-28 2:28 ` Masami Hiramatsu [this message]
2017-09-11 10:28 ` [PATCH -tip v3 0/2] kprobes/x86: Another way to make insn buffer RO and cleanup Masami Hiramatsu
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=20170828112804.c7146d3246dfcf34a9671daf@kernel.org \
--to=mhiramat@kernel.org \
--cc=ananth@in.ibm.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=davem@davemloft.net \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=x86@kernel.org \
/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