]> git.baikalelectronics.ru Git - kernel.git/commit
tracing/kprobe: bpf: Check error injectable event is on function entry
authorMasami Hiramatsu <mhiramat@kernel.org>
Fri, 12 Jan 2018 17:54:04 +0000 (02:54 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 13 Jan 2018 01:33:37 +0000 (17:33 -0800)
commitc109ff1d8679773b662b6e064fbfa65d0b43448f
tree0a8d2bfcd4dc6a32524dc2b83d2c9169f9bf124a
parent8b9a6dadf156a78287eba8031c4e8430e08549c3
tracing/kprobe: bpf: Check error injectable event is on function entry

Check whether error injectable event is on function entry or not.
Currently it checks the event is ftrace-based kprobes or not,
but that is wrong. It should check if the event is on the entry
of target function. Since error injection will override a function
to just return with modified return value, that operation must
be done before the target function starts making stackframe.

As a side effect, bpf error injection is no need to depend on
function-tracer. It can work with sw-breakpoint based kprobe
events too.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/x86/include/asm/kprobes.h
arch/x86/kernel/kprobes/core.c
arch/x86/kernel/kprobes/ftrace.c
kernel/trace/Kconfig
kernel/trace/bpf_trace.c
kernel/trace/trace_kprobe.c
kernel/trace/trace_probe.h