lkml.org 
[lkml]   [2019]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Oops caused by race between livepatch and ftrace
On Mon, May 20, 2019 at 05:39:10PM -0400, Steven Rostedt wrote:
> On Mon, 20 May 2019 16:19:31 -0500
> Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>
> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > index a12aff849c04..8259d4ba8b00 100644
> > --- a/kernel/trace/ftrace.c
> > +++ b/kernel/trace/ftrace.c
> > @@ -34,6 +34,7 @@
> > #include <linux/hash.h>
> > #include <linux/rcupdate.h>
> > #include <linux/kprobes.h>
> > +#include <linux/memory.h>
> >
> > #include <trace/events/sched.h>
> >
> > @@ -2610,10 +2611,12 @@ static void ftrace_run_update_code(int command)
> > {
> > int ret;
> >
> > + mutex_lock(&text_mutex);
> > +
>
> Hmm, this may blow up with lockdep, as I believe we already have a
> locking dependency of:
>
> text_mutex -> ftrace_lock
>
> And this will reverses it. (kprobes appears to take the locks in this
> order).
>
> Perhaps have live kernel patching grab ftrace_lock?

Where does kprobes call into ftrace with the text_mutex? I couldn't
find it.

--
Josh

\
 
 \ /
  Last update: 2019-05-21 16:17    [W:0.065 / U:4.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site