Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1235435

Re: [RFC][PATCH] sched: Fix TASK_DEAD race in finish_task_switch()

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH] sched: Fix TASK_DEAD race in finish_task_switch()
Date 2015-09-29 19:50 +0200
Message-ID <qe7cm-50W-15@gated-at.bofh.it> (permalink)
References <qe2FI-6Wy-5@gated-at.bofh.it> <qe6gh-3Gy-13@gated-at.bofh.it> <qe6pY-3RG-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC][PATCH] sched: Fix TASK_DEAD race in finish_task_switch() Peter Zijlstra <peterz@infradead.org> - 2015-09-29 15:00 +0200
  Re: [RFC][PATCH] sched: Fix TASK_DEAD race in finish_task_switch() Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-29 18:50 +0200
    Re: [RFC][PATCH] sched: Fix TASK_DEAD race in finish_task_switch() Peter Zijlstra <peterz@infradead.org> - 2015-09-29 19:00 +0200
      Re: [RFC][PATCH] sched: Fix TASK_DEAD race in finish_task_switch() Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-29 19:50 +0200

csiph-web