From 7cdf388658ab50619c54c5b642102bebd78dddb0 Mon Sep 17 00:00:00 2001 From: Christian Poetzsch Date: Wed, 3 Jun 2015 12:07:33 +0100 Subject: [PATCH] Fix generic cgroup subsystem permission checks In 53b5e2f generic cgroup subsystem permission checks have been added. When this is been done within procs_write an empty taskset is added to the tasks css set. When a task later on migrates to a new group we see a dmesg warning cause the mg_node isn't empty (cgroup.c:2086). Cause this happens all the time this spams dmesg. I am not really familiar with this code, but it looks to me like adding the taskset is just a temporary action in this context. Therefore this taskset should be removed after the actual check. This is what this fix does. This problem was seen and the fix tested on x86 using l-mr1 and master. Change-Id: I9894d39e8b5692ef65149002b07e65a84a33ffea Signed-off-by: Christian Poetzsch --- kernel/cgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 1d9b84f966c4..6af8d042d9f8 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -2465,6 +2465,7 @@ retry_find_task: cset = task_css_set(tsk); list_add(&cset->mg_node, &tset.src_csets); ret = cgroup_allow_attach(cgrp, &tset); + list_del(&tset.src_csets); if (ret) { rcu_read_unlock(); goto out_unlock_cgroup;