[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130719163312.GA21544@redhat.com>
Date: Fri, 19 Jul 2013 18:33:12 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Ingo Molnar <mingo@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] tracing: Simplify trace_array_get()
On 07/19, Steven Rostedt wrote:
>
> On Fri, 2013-07-19 at 17:51 +0200, Oleg Nesterov wrote:
> > mutex_lock(&trace_types_lock);
> > - list_for_each_entry(tr, &ftrace_trace_arrays, list) {
> > - if (tr == this_tr) {
> > - tr->ref++;
> > - ret = 0;
> > - break;
> > - }
> > + if (!list_empty(&this_tr->list)) {
>
> Because this_tr can be freed outside the lock. Accessing this_tr->list
> can cause a crash.
Aaah, indeed.
Thanks Steven!
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists