Kprobe code has a mecanism protecting against triggering kprobe during
the handling of an event. If a kprobe is placed between the kprobe
handling entry point and the activation of this protection, the user can
cause an infinite kprobe recursion leading to a kernel crash.

To avoid this, prevent kprobes from being placed in notrace functions.

Also, move the kprobe selftest target function in its own compile unit
so it's not marked as notrace and can thus be used in the ftrace startup
tests.

Francis Deslauriers (1):
  selftest/ftrace: Move kprobe selftest function to separate compile
    unit

Masami Hiramatsu (1):
  tracing: kprobes: Prohibit probing on notrace functions

 kernel/trace/Makefile                |  5 +++++
 kernel/trace/trace_kprobe.c          | 35 ++++++++++++++++++++++++-----------
 kernel/trace/trace_kprobe_selftest.c | 10 ++++++++++
 kernel/trace/trace_kprobe_selftest.h |  7 +++++++
 4 files changed, 46 insertions(+), 11 deletions(-)
 create mode 100644 kernel/trace/trace_kprobe_selftest.c
 create mode 100644 kernel/trace/trace_kprobe_selftest.h

-- 
2.7.4

Reply via email to