From f4adb71017ba546f8077b681c3953479e580a541 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 de6515d19279..ad495f0f59bb 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -2729,6 +2729,7 @@ static int cgroup_procs_write_permission(struct task_struct *task, cset = task_css_set(task); list_add(&cset->mg_node, &tset.src_csets); ret = cgroup_allow_attach(dst_cgrp, &tset); + list_del(&tset.src_csets); if (ret) ret = -EACCES; } -- 2.34.1