From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Ingo Molnar <mingo@kernel.org>
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: Re: [PATCH -tip RFC 0/2] kprobes: introduce NOKPROBE_SYMBOL() and prohibit probing on .entry.text
Date: Tue, 12 Nov 2013 02:18:53 +0900 [thread overview]
Message-ID: <5281117D.3010202@hitachi.com> (raw)
In-Reply-To: <20131111111618.GA15810@gmail.com>
(2013/11/11 20:16), Ingo Molnar wrote:
>
> * 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
Sure, that's why I introduced this :)
> After that we can convert all the rest, probably as part of this series.
OK, I'll do. :)
BTW, converting all the __kprobes involves many archs, which
kprobes ported. In that case, which mailing-list would better me
to post the series, linux-arch?
>
> There's a good reason now to do it: it's not just about cleanliness, it
> will also impact generated code less.
Thank you!
--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
next prev parent reply other threads:[~2013-11-11 17:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` [PATCH -tip RFC 2/2] kprobes: Introduce NOKPROBE_SYMBOL() macro for blacklist 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 17:18 ` Masami Hiramatsu [this message]
2013-11-11 17:25 ` Steven Rostedt
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=5281117D.3010202@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=ananth@in.ibm.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome