From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Francis Deslauriers <francis.deslauriers@efficios.com>,
peterz@infradead.org, Shuah Khan <shuah@kernel.org>,
mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/3] tracing: kprobes: Prohibit probing on notrace function
Date: Tue, 31 Jul 2018 10:04:34 +0900 [thread overview]
Message-ID: <20180731100434.3a867bde77575c993c19c7fe@kernel.org> (raw)
In-Reply-To: <20180730184010.0d5597a1@gandalf.local.home>
On Mon, 30 Jul 2018 18:40:10 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Mon, 30 Jul 2018 19:20:14 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> > Prohibit kprobe-events probing on notrace function.
> > Since probing on the notrace function can cause recursive
> > event call. In most case those are just skipped, but
> > in some case it falls into infinit recursive call.
> >
> > This protection can be disabled by the kconfig
> > CONFIG_KPROBE_EVENTS_ON_NOTRACE=y, but it is highly
> > recommended to keep it "n" for normal kernel.
> > Note that this is only available if "kprobes on ftrace"
> > has been implemented on target arch and
> > CONFIG_KPROBES_ON_FTRACE=y.
> >
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> >
>
> Hi Masami,
>
> Note, I made the following changes for grammar. For the Change log I
> have this:
>
> tracing: kprobes: Prohibit probing on notrace function
>
> Prohibit kprobe-events probing on notrace functions. Since probing on a
> notrace function can cause a recursive event call. In most cases those are just
> skipped, but in some cases it falls into an infinite recursive call.
>
> This protection can be disabled by the kconfig
> CONFIG_KPROBE_EVENTS_ON_NOTRACE=y, but it is highly recommended to keep it
> "n" for normal kernel builds. Note that this is only available if "kprobes on
> ftrace" has been implemented on the target arch and CONFIG_KPROBES_ON_FTRACE=y.
>
> Link: http://lkml.kernel.org/r/153294601436.32740.10557881188933661239.stgit@devbox
>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Tested-by: Francis Deslauriers <francis.deslauriers@efficios.com>
> [ Slight grammar and spelling fixes ]
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Looks good to me.
Thanks for fixing it! :)
>
>
> And this change to the patch:
>
> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
> index 4d4eb15cc7fd..23fc7c9abedb 100644
> --- a/kernel/trace/Kconfig
> +++ b/kernel/trace/Kconfig
> @@ -457,7 +457,7 @@ config KPROBE_EVENTS
> If you want to use perf tools, this option is strongly recommended.
>
> config KPROBE_EVENTS_ON_NOTRACE
> - bool "Do NOT protect notrace function from kprobe events"
> + bool "Do NOT protect notrace functions from kprobe events"
> depends on KPROBE_EVENTS
> depends on KPROBES_ON_FTRACE
> default n
> @@ -465,13 +465,13 @@ config KPROBE_EVENTS_ON_NOTRACE
> This is only for the developers who want to debug ftrace itself
> using kprobe events.
>
> - If kprobes can use ftrace instead of breakpoint, ftrace related
> - functions are protected from kprobe-events to prevent an infinit
> - recursion or any unexpected execution path which leads to a kernel
> - crash.
> + If kprobes is using ftrace to hook to a function instead of a
> + breakpoint, ftrace related functions are protected from
> + kprobe-events to prevent an infinite recursion or any unexpected
> + execution path which would lead to a kernel crash.
>
> This option disables such protection and allows you to put kprobe
> - events on ftrace functions for debugging ftrace by itself.
> + events on ftrace functions for debugging ftrace itself.
> Note that this might let you shoot yourself in the foot.
>
> If unsure, say N.
>
>
> Are you OK with this?
>
> -- Steve
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2018-07-31 1:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-30 10:19 [PATCH v5 0/3] tracing: kprobes: Prohibit probing on notrace functions Masami Hiramatsu
2018-07-30 10:20 ` [PATCH v5 1/3] tracing: kprobes: Prohibit probing on notrace function Masami Hiramatsu
2018-07-30 22:40 ` Steven Rostedt
2018-07-31 1:04 ` Masami Hiramatsu [this message]
2018-07-30 10:20 ` [PATCH v5 2/3] selftest/ftrace: Move kprobe selftest function to separate compile unit Masami Hiramatsu
2018-07-30 10:21 ` [PATCH v5 3/3] selftests/ftrace: Fix kprobe string testcase to not probe notrace function Masami Hiramatsu
2018-07-30 16:06 ` [PATCH v5 0/3] tracing: kprobes: Prohibit probing on notrace functions Francis Deslauriers
2018-07-30 23:00 ` 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=20180731100434.3a867bde77575c993c19c7fe@kernel.org \
--to=mhiramat@kernel.org \
--cc=francis.deslauriers@efficios.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=shuah@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