[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190521141629.bmk5onsaab26qoaw@treble>
Date: Tue, 21 May 2019 09:16:29 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Johannes Erdfelt <johannes@...felt.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
Jessica Yu <jeyu@...nel.org>, Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Ingo Molnar <mingo@...hat.com>, live-patching@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: 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@...hat.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
Powered by blists - more mailing lists