All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: x86@kernel.org, Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	lkml <linux-kernel@vger.kernel.org>,
	"Steven Rostedt (Red Hat)" <rostedt@goodmis.org>,
	virtualization@lists.linux-foundation.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH -tip RFC 0/2] kprobes: introduce NOKPROBE_SYMBOL() and prohibit probing on .entry.text
Date: Mon, 11 Nov 2013 12:16:18 +0100	[thread overview]
Message-ID: <20131111111618.GA15810@gmail.com> (raw)
In-Reply-To: <20131108125213.19972.49271.stgit@kbuild-fedora.novalocal>


* Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> wrote:

> Currently the blacklist is maintained by hand in kprobes.c 
> which is separated from the function definition and is hard
> to catch up the kernel update.
> To solve this issue, I've tried to implement new
> NOKPROBE_SYMBOL() macro for making kprobe blacklist at 
> build time. Since the NOKPROBE_SYMBOL() macros can be placed
> right after the function is defined, it is easy to maintain.
> At this moment, I applied the macro only for the symbols
> which is listed in kprobes.c. As we discussed in previous
> thread, if the gcc accepts to introduce new annotation to
> store the function address (and size) at somewhere, we can
> easily move onto that by replacing NOKPROBE_SYMBOL() with
> nokprobe annotation (and just modifying the
> populate_kprobe_blacklist() a bit).
> 
> This series also includes a change which prohibits probing
> on the address in .entry.text because the code is used for
> very low-level sensitive interrupt/syscall entries. Probing
> such code may cause unexpected result (actually most of
> that area is already in the kprobe blacklist).
> So I've decide to prohibit probing all of them.
> 
> Since Ingo wasn't convinced about the idea in the previous
> discussion, I just make this series as RFC series.
> I'd like to ask again with actual implementation and plan.
> 
> Thank you,
> 
> ---
> 
> Masami Hiramatsu (2):
>       kprobes: Prohibit probing on .entry.text code
>       kprobes: Introduce NOKPROBE_SYMBOL() macro for blacklist
> 
> 
>  arch/x86/kernel/entry_32.S        |   33 ------------
>  arch/x86/kernel/entry_64.S        |   20 --------
>  arch/x86/kernel/paravirt.c        |    4 ++
>  include/asm-generic/vmlinux.lds.h |    9 +++
>  include/linux/kprobes.h           |   19 +++++++
>  kernel/kprobes.c                  |   98 ++++++++++++++++++-------------------
>  kernel/sched/core.c               |    1 
>  7 files changed, 80 insertions(+), 104 deletions(-)

Ok, I like it after all.

Mind changing over arch/x86/kprobes/* to use this new facility? There's no 
sense in kprobes internals using two types

After that we can convert all the rest, probably as part of this series.

There's a good reason now to do it: it's not just about cleanliness, it 
will also impact generated code less.

Thanks,

	Ingo

  parent reply	other threads:[~2013-11-11 11:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 12:52 [PATCH -tip RFC 0/2] kprobes: introduce NOKPROBE_SYMBOL() and prohibit probing on .entry.text Masami Hiramatsu
2013-11-08 12:52 ` Masami Hiramatsu
2013-11-08 12:52 ` [PATCH -tip RFC 1/2] kprobes: Prohibit probing on .entry.text code Masami Hiramatsu
2013-11-08 12:52   ` Masami Hiramatsu
2013-11-08 12:52 ` [PATCH -tip RFC 2/2] kprobes: Introduce NOKPROBE_SYMBOL() macro for blacklist Masami Hiramatsu
2013-11-08 12:52   ` Masami Hiramatsu
2013-11-11 11:16 ` [PATCH -tip RFC 0/2] kprobes: introduce NOKPROBE_SYMBOL() and prohibit probing on .entry.text Ingo Molnar
2013-11-11 11:16 ` Ingo Molnar [this message]
2013-11-11 17:18   ` Masami Hiramatsu
2013-11-11 17:18     ` Masami Hiramatsu
2013-11-11 17:25     ` Steven Rostedt
2013-11-11 17:25       ` Steven Rostedt
2013-11-11 21:15       ` Ingo Molnar
2013-11-11 21:15         ` Ingo Molnar

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=20131111111618.GA15810@gmail.com \
    --to=mingo@kernel.org \
    --cc=ananth@in.ibm.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=virtualization@lists.linux-foundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.