cgroup: fix RCU accesses around task->cgroups
authorTejun Heo <tj@kernel.org>
Fri, 21 Jun 2013 22:52:04 +0000 (15:52 -0700)
committerTejun Heo <tj@kernel.org>
Wed, 26 Jun 2013 17:48:38 +0000 (10:48 -0700)
commita8ad805cfde00be8fe3b3dae8890996dbeb91e2c
treecfe59b30636f951244c748eaab000da68d20a159
parent14611e51a57df10240817d8ada510842faf0ec51
cgroup: fix RCU accesses around task->cgroups

There are several places in kernel/cgroup.c where task->cgroups is
accessed and modified without going through proper RCU accessors.
None is broken as they're all lock protected accesses; however, this
still triggers sparse RCU address space warnings.

* Consistently use task_css_set() for task->cgroups dereferencing.

* Use RCU_INIT_POINTER() to clear task->cgroups to &init_css_set on
  exit.

* Remove unnecessary rcu_dereference_raw() from cset->subsys[]
  dereference in cgroup_exit().

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Li Zefan <lizefan@huawei.com>
kernel/cgroup.c