[PATCH 1/2] device_cgroup: fix RCU usage

Tejun Heo tj at kernel.org
Tue Nov 6 20:29:17 UTC 2012


On Tue, Nov 06, 2012 at 11:48:41AM -0600, Serge Hallyn wrote:
> Quoting Tejun Heo (tj at kernel.org):
> > dev_cgroup->exceptions is protected with devcgroup_mutex for writes
> > and RCU for reads; however, RCU usage isn't correct.
> > 
> > * dev_exception_clean() doesn't use RCU variant of list_del() and
> >   kfree().  The function can race with may_access() and may_access()
> >   may end up dereferencing already freed memory.  Use list_del_rcu()
> >   and kfree_rcu() instead.
> > 
> > * may_access() may be called only with RCU read locked but doesn't use
> >   RCU safe traversal over ->exceptions.  Use list_for_each_entry_rcu().
> > 
> > Signed-off-by: Tejun Heo <tj at kernel.org>
> > Cc: stable at vger.kernel.org
> > Cc: Aristeu Rozanski <aris at redhat.com>
> > Cc: Li Zefan <lizefan at huawei.com>
> > Cc: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

Thanks, applied to cgroup/for-3.7-fixes.

-- 
tejun


More information about the Containers mailing list