[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1393729211-937-1-git-send-email-sasha.levin@oracle.com>
Date: Sat, 1 Mar 2014 22:00:11 -0500
From: Sasha Levin <sasha.levin@...cle.com>
To: tj@...nel.org, lizefan@...wei.com
Cc: containers@...ts.linux-foundation.org, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, Sasha Levin <sasha.levin@...cle.com>
Subject: [PATCH] cgroup: missing rcu read lock around task_css_set
rcu read lock should be held when calling and working with task_css_set.
This patch also fixes a related lockdep warning.
Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
---
kernel/cgroup.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 8f4ddbe..f638ad6 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4361,6 +4361,7 @@ void cgroup_exit(struct task_struct *tsk, int run_callbacks)
}
/* Reassign the task to the init_css_set. */
+ rcu_read_lock();
cset = task_css_set(tsk);
RCU_INIT_POINTER(tsk->cgroups, &init_css_set);
@@ -4378,6 +4379,7 @@ void cgroup_exit(struct task_struct *tsk, int run_callbacks)
if (put_cset)
put_css_set(cset, true);
+ rcu_read_unlock();
}
static void check_for_release(struct cgroup *cgrp)
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists