Skip to content

ftrace: prevent ftrace modifications while being kprobe'd

Abhishek Sagar lkml 1 version Applied

Status from this message: applied to tip/tracing/ftrace, thanks Abhishek.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4ftrace: store mcount address in rec->iparch/arm/kernel/armksyms.c arch/arm/kernel/entry-common.S arch/arm/kernel/ftrace.c +16 more+110 -560 replies
2/4kprobes: enable clean usage of get_kprobeinclude/linux/kprobes.h+4 -01 reply
3/4ftrace: avoid modifying kprobe'd recordskernel/trace/ftrace.c+31 -40 replies
4/4ftrace: freeze kprobe'd recordsinclude/linux/ftrace.h kernel/trace/ftrace.c kernel/trace/trace.c+87 -30 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchAnanth N Mavinakayanahalli
1/4
2/4A-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] ftrace: prevent ftrace modifications while being kprobe'd

Hi Steven/Ingo,

These patches address the problem of kprobe registration interfering with dynamic ftrace. A kprobe registered on an mcount call-site can modify that address multiple times during its duration of probing. At the same time, ftrace may simultaneously modify these locations. This could be fatal especially if ftrace modifies the call-site during a kprobe registration on it (between arch_prepare_kprobe and arch_arm_kprobe in __register_kprobe to be more precise). So as a "fix", I've disabled any updates on the mcount call-site while it's being kprobe'd.

--
Regards,
Abhishek Sagar