sched, cgroup: Use exit hook to avoid use-after-free crash
authorPeter Zijlstra <peterz@infradead.org>
Wed, 19 Jan 2011 11:26:11 +0000 (12:26 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 19 Jan 2011 11:51:32 +0000 (12:51 +0100)
commit068c5cc5ac7414a8e9eb7856b4bf3cc4d4744267
tree28a017e342dddd3ffe8e3dd3499a395aee39b796
parentd7d8294415f0ce4254827d4a2a5ee88b00be52a8
sched, cgroup: Use exit hook to avoid use-after-free crash

By not notifying the controller of the on-exit move back to
init_css_set, we fail to move the task out of the previous
cgroup's cfs_rq. This leads to an opportunity for a
cgroup-destroy to come in and free the cgroup (there are no
active tasks left in it after all) to which the not-quite dead
task is still enqueued.

Reported-by: Miklos Vajna <vmiklos@frugalware.org>
Fixed-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: <stable@kernel.org>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <1293206353.29444.205.camel@laptop>
kernel/sched.c