From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Zefan Subject: Re: [PATCH cgroup/for-3.11 2/3] cgroup: fix RCU accesses around task->cgroups Date: Wed, 26 Jun 2013 11:29:46 +0800 Message-ID: <51CA602A.8020906@huawei.com> References: <20130621225116.GC3949@htj.dyndns.org> <20130621225204.GD3949@htj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130621225204.GD3949-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Tejun Heo Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Fengguang Wu On 2013/6/22 6:52, Tejun Heo wrote: > 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 > Reported-by: Fengguang Wu Acked-by: Li Zefan