]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Mar 2014 17:29:54 +0000 (10:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Mar 2014 17:29:54 +0000 (10:29 -0700)
added patches:
sched-autogroup-fix-race-with-task_groups-list.patch

queue-3.10/sched-autogroup-fix-race-with-task_groups-list.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/sched-autogroup-fix-race-with-task_groups-list.patch b/queue-3.10/sched-autogroup-fix-race-with-task_groups-list.patch
new file mode 100644 (file)
index 0000000..6e33953
--- /dev/null
@@ -0,0 +1,48 @@
+From 41261b6a832ea0e788627f6a8707854423f9ff49 Mon Sep 17 00:00:00 2001
+From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
+Date: Fri, 24 May 2013 18:07:49 +0200
+Subject: sched/autogroup: Fix race with task_groups list
+
+From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
+
+commit 41261b6a832ea0e788627f6a8707854423f9ff49 upstream.
+
+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 <gerald.schaefer@de.ibm.com>
+Signed-off-by: Peter Zijlstra <peterz@infradead.org>
+Link: http://lkml.kernel.org/r/1369411669-46971-2-git-send-email-gerald.schaefer@de.ibm.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/sched/auto_group.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/kernel/sched/auto_group.c
++++ b/kernel/sched/auto_group.c
+@@ -77,8 +77,6 @@ static inline struct autogroup *autogrou
+       if (IS_ERR(tg))
+               goto out_free;
+-      sched_online_group(tg, &root_task_group);
+-
+       kref_init(&ag->kref);
+       init_rwsem(&ag->lock);
+       ag->id = atomic_inc_return(&autogroup_seq_nr);
+@@ -98,6 +96,7 @@ static inline struct autogroup *autogrou
+ #endif
+       tg->autogroup = ag;
++      sched_online_group(tg, &root_task_group);
+       return ag;
+ out_free:
index 745365ef6f906e1ed154b347b5b6c3ab69cd210a..8ede6748517f5882139ea29dbd39a8253d022d74 100644 (file)
@@ -19,3 +19,4 @@ kvm-vmx-fix-use-after-free-of-vmx-loaded_vmcs.patch
 input-wacom-make-sure-touch_max-is-set-for-touch-devices.patch
 xhci-fix-resume-issues-on-renesas-chips-in-samsung-laptops.patch
 e100-fix-disabling-already-disabled-device-warning.patch
+sched-autogroup-fix-race-with-task_groups-list.patch