[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190108114123.7b47c5c9365f856ee36f3ac3@kernel.org>
Date: Tue, 8 Jan 2019 11:41:23 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Andrea Righi <righi.andrea@...il.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Ingo Molnar <mingo@...hat.com>, peterz@...radead.org,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] kprobes: Mark ftrace mcount handler functions
nokprobe
On Mon, 7 Jan 2019 12:29:51 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Mon, 7 Jan 2019 15:55:36 +0100
> Andrea Righi <righi.andrea@...il.com> wrote:
>
> > On Mon, Jan 07, 2019 at 10:32:32PM +0900, Masami Hiramatsu wrote:
> > > Mark ftrace mcount handler functions nokprobe since
> > > probing on these functions with kretprobe pushes
> > > return address incorrectly on kretprobe shadow stack.
> > >
> > > Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> > > Reported-by: Francis Deslauriers <francis.deslauriers@...icios.com>
> > > ---
> > > kernel/trace/ftrace.c | 5 ++++-
> > > 1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > > index f0ff24173a0b..ad4babad4a03 100644
> > > --- a/kernel/trace/ftrace.c
> > > +++ b/kernel/trace/ftrace.c
> > > @@ -6250,7 +6250,7 @@ void ftrace_reset_array_ops(struct trace_array *tr)
> > > tr->ops->func = ftrace_stub;
> > > }
> > >
> > > -static inline void
> > > +static nokprobe_inline void
> >
> > I think we need to #include <linux/kprobes.h>, otherwise:
> >
> > CC kernel/trace/ftrace.o
> > kernel/trace/ftrace.c:6219:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
> > static nokprobe_inline void
> > ^~~~
> >
> > kernel/trace/ftrace.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > index 3a58ad280d83..0333241034d5 100644
> > --- a/kernel/trace/ftrace.c
> > +++ b/kernel/trace/ftrace.c
> > @@ -32,6 +32,7 @@
> > #include <linux/sort.h>
> > #include <linux/list.h>
> > #include <linux/hash.h>
> > +#include <linux/kprobes.h>
> > #include <linux/rcupdate.h>
> >
> > #include <trace/events/sched.h>
>
> And zero day just caught it too.
>
> Masami, want to fold this into your patch and send out a v2?
Yes, I'll do that.
Thank you,
>
> -- Steve
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists