From: Sasha Levin <sasha.levin@oracle.com>
To: tj@kernel.org, lizefan@huawei.com
Cc: containers@lists.linux-foundation.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org,
Sasha Levin <sasha.levin@oracle.com>
Subject: [PATCH] cgroup: missing rcu read lock around task_css_set
Date: Sat, 1 Mar 2014 22:00:11 -0500 [thread overview]
Message-ID: <1393729211-937-1-git-send-email-sasha.levin@oracle.com> (raw)
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@oracle.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
next reply other threads:[~2014-03-02 3:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-02 3:00 Sasha Levin [this message]
2014-03-03 22:33 ` Tejun Heo
2014-03-03 22:43 ` Sasha Levin
2014-03-03 22:45 ` Tejun Heo
2014-03-03 22:48 ` Sasha Levin
2014-03-03 23:00 ` Sasha Levin
2014-03-04 17:20 ` Sasha Levin
2014-03-04 19:47 ` Tejun Heo
2014-03-05 0:57 ` Li Zefan
2014-03-27 15:35 ` Sasha Levin
2014-03-28 2:48 ` Li Zefan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1393729211-937-1-git-send-email-sasha.levin@oracle.com \
--to=sasha.levin@oracle.com \
--cc=cgroups@vger.kernel.org \
--cc=containers@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®