1 Aug 2011 21:31
Re: [PATCH][BUGFIX] cgroups: more safe tasklist locking in cgroup_attach_proc
On Fri, Jul 29, 2011 at 7:28 AM, Ben Blum <bblum@...> wrote: > Fix unstable tasklist locking in cgroup_attach_proc. > > From: Ben Blum <bblum@...> > > According to this thread - https://lkml.org/lkml/2011/7/27/243 - RCU is > not sufficient to guarantee the tasklist is stable w.r.t. de_thread and > exit. Taking tasklist_lock for reading, instead of rcu_read_lock, > ensures proper exclusion. > > Signed-off-by: Ben Blum <bblum@...> Acked-by: Paul Menage <menage@...> Thanks, Paul > --- > kernel/cgroup.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff a/kernel/cgroup.c b/kernel/cgroup.c > --- a/kernel/cgroup.c 2011-07-21 19:17:23.000000000 -0700 > +++ b/kernel/cgroup.c 2011-07-29 06:17:47.000000000 -0700 > <at> <at> -2024,7 +2024,7 <at> <at> > goto out_free_group_list; > > /* prevent changes to the threadgroup list while we take a snapshot. */ > - rcu_read_lock(); > + read_lock(&tasklist_lock);(Continue reading)
RSS Feed