Re: [PATCH -v5 00/17] Rewrite x86/ftrace to use text_poke (and more)

From: Masami Hiramatsu
Date: Wed Nov 27 2019 - 01:47:35 EST


On Tue, 26 Nov 2019 20:32:29 -0800
Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote:

> On Tue, Nov 26, 2019 at 4:03 PM Alexei Starovoitov
> <alexei.starovoitov@xxxxxxxxx> wrote:
> >
> >
> >
> > On Tue, Nov 26, 2019 at 3:49 PM Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
> >>
> >> On Tue, 26 Nov 2019 18:58:09 +0900
> >> Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
> >> > I applied following patch, but it seems not enough. While disabling 256 kprobes,
> >> > system was frozen (no BUG message).
> >>
> >> Aah, this is another bug in optprobe. I'll send a series for fix these bugs.
> >
> >
> > Awesome! I’ve started looking at this crash as well.
> > Could you share a brief description of the bug and cc me on fixes?
> > I’d like to test them too.

Yeah, please see my patches sent now.

> > Thanks
>
> I noticed that your config doesn't have CONFIG_KPROBES_ON_FTRACE=y
> and without it most test.d/kprobe/ tests fail, but in your log they are passing.
> Also do you have KPROBE_EVENTS_ON_NOTRACE=y ?

That is a secondary results of disabling FUNCTION_TRACER. And that error
has been fixed by following series :)

157475724667.3389.15752644047898709246.stgit@devnote2">https://lkml.kernel.org/r/157475724667.3389.15752644047898709246.stgit@devnote2

> Since without these two configs the crash wasn't reproducing for me.
> Anyhow waiting for your fixes.

Yeah, this config is accidentally changed multiple-kprobes.tc test
behavior. With the FUNCTION_TRACER, most of the target functions have
5-bytes nop on the entry as the room for ftrace instrumentation.
Thus the multiple-kprobes.tc adds 5-bytes offset to avoiding that nops.
In this case, most of the "symbol+5" address are on the instruction
boundaries.
But without FUNCTION_TRACER, those nops are gone, and (roughly) a half of
"symbol+5" are not on the instruction boundaries anymore. Thus, the set of
target functions are changed and hit this bug.

Thank you,

--
Masami Hiramatsu <mhiramat@xxxxxxxxxx>