From: Gerald Schaefer Date: Fri, 24 May 2013 16:07:49 +0000 (+0200) Subject: sched/autogroup: Fix race with task_groups list X-Git-Tag: omap-for-v3.11/fixes-for-merge-window~61^2~40 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41261b6a832ea0e788627f6a8707854423f9ff49;p=pandora-kernel.git sched/autogroup: Fix race with task_groups list In autogroup_create(), a tg is allocated and added to the task_groups list. If CONFIG_RT_GROUP_SCHED is set, this tg is then modified while on the list, without locking. This can race with someone walking the list, like __enable_runtime() during CPU unplug, and result in a use-after-free bug. To fix this, move sched_online_group(), which adds the tg to the list, to the end of the autogroup_create() function after the modification. Signed-off-by: Gerald Schaefer Signed-off-by: Peter Zijlstra Link: http://lkml.kernel.org/r/1369411669-46971-2-git-send-email-gerald.schaefer@de.ibm.com Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed