linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] tracing: Simplify trace_array_get()
Date: Fri, 19 Jul 2013 18:33:12 +0200	[thread overview]
Message-ID: <20130719163312.GA21544@redhat.com> (raw)
In-Reply-To: <1374251217.3356.12.camel@gandalf.local.home>

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.


  reply	other threads:[~2013-07-19 16:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 15:50 [PATCH 0/1] tracing: Simplify trace_array_get() Oleg Nesterov
2013-07-19 15:51 ` [PATCH 1/1] " Oleg Nesterov
2013-07-19 16:26   ` Steven Rostedt
2013-07-19 16:33     ` Oleg Nesterov [this message]
2013-07-19 17:20       ` Oleg Nesterov
2013-07-19 17:35         ` Steven Rostedt
2013-07-19 17:39           ` Steven Rostedt
2013-07-19 18:24           ` Oleg Nesterov
2013-07-21 19:14             ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130719163312.GA21544@redhat.com \
    --to=oleg@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).