linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Manfred Spraul <manfred@colorfullife.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [RFC][PATCH] sched: Fix TASK_DEAD race in finish_task_switch()
Date: Tue, 29 Sep 2015 13:41:50 -0400	[thread overview]
Message-ID: <CA+55aFy6j3YFF6vZDgT4cX62L02bqRBDDx0MaR+qT-rmG+a0wA@mail.gmail.com> (raw)
In-Reply-To: <20150929165031.GU3816@twins.programming.kicks-ass.net>

On Tue, Sep 29, 2015 at 12:50 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> The control dependency creates a LOAD->STORE order, that is, no STOREs
> can happen until we observe !p->on_cpu.

Fair enough.

> Right, but wmb isn't sufficient as it doesn't order the prev->state LOAD
> vs the prev->on_cpu = 0 STORE. If those happen in the wrong order the
> described race can happen and we get a use-after-free.

.. and you convinced me. The patch is good. Ack.

               Linus

  reply	other threads:[~2015-09-29 17:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 12:45 [RFC][PATCH] sched: Fix TASK_DEAD race in finish_task_switch() Peter Zijlstra
2015-09-29 16:40 ` Linus Torvalds
2015-09-29 16:50   ` Peter Zijlstra
2015-09-29 17:41     ` Linus Torvalds [this message]
2015-10-06 16:12 ` [tip:sched/core] sched/core: " tip-bot for Peter Zijlstra

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=CA+55aFy6j3YFF6vZDgT4cX62L02bqRBDDx0MaR+qT-rmG+a0wA@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /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).