lkml.org 
[lkml]   [2008]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/4] ftrace: prevent ftrace modifications while being kprobe'd

* Abhishek Sagar <sagar.abhishek@gmail.com> wrote:

> 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.

applied to tip/tracing/ftrace, thanks Abhishek.

note that i had to do a number of fixups to themerge, and there was one
chunk which did not merge cleanly and i left it out for now:

@@ -435,8 +502,12 @@ static void ftrace_replace_code(int enable)
continue;

/* ignore updates to this record's mcount site */
- if (get_kprobe((void *)rec->ip))
+ if (get_kprobe((void *)rec->ip)) {
+ freeze_record(rec);
continue;
+ } else {
+ unfreeze_record(rec);
+ }

please send a delta patch against tip/tracing/ftrace to get that kprobes
fix. You can pick up -tip via:

http://people.redhat.com/mingo/tip.git/README

Ingo


\
 
 \ /
  Last update: 2008-06-23 22:17    [W:0.105 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site