summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-10-03 10:40:36 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-10-03 10:40:36 -0700
commit847d9fb477c3a16cc177751e24fcc1aafcd699d6 (patch)
tree002efb294a5e5e7552967f631eeb102ed9de5ddd
parentff93026d51935b671b4ac131886f0914f8b6189a (diff)
parentc4fa6c43ce4b427350cfbb659436bfe3d9e09a1d (diff)
downloadlinux-stable-847d9fb477c3a16cc177751e24fcc1aafcd699d6.tar.gz
linux-stable-847d9fb477c3a16cc177751e24fcc1aafcd699d6.tar.bz2
linux-stable-847d9fb477c3a16cc177751e24fcc1aafcd699d6.zip
Merge branch 'for-4.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fix from Tejun Heo: "The recent migration code updates assumed that migrations always execute from the top to the bottom once and didn't clean up internal states after each migration round; however, cgroup_transfer_tasks() repeats the inner steps multiple times and the garbage internal states from the previous iteration led to OOPS. Waiman fixed the bug by reinitializing the relevant states at the end of each migration round" * 'for-4.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Reinit cgroup_taskset structure before cgroup_migrate_execute() returns
-rw-r--r--kernel/cgroup/cgroup.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index d6551cd45238..44857278eb8a 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -2311,6 +2311,14 @@ out_release_tset:
list_del_init(&cset->mg_node);
}
spin_unlock_irq(&css_set_lock);
+
+ /*
+ * Re-initialize the cgroup_taskset structure in case it is reused
+ * again in another cgroup_migrate_add_task()/cgroup_migrate_execute()
+ * iteration.
+ */
+ tset->nr_tasks = 0;
+ tset->csets = &tset->src_csets;
return ret;
}