]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cgroups: more safe tasklist locking in cgroup_attach_proc
authorBen Blum <bblum@andrew.cmu.edu>
Wed, 5 Oct 2011 00:43:44 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Oct 2011 06:07:00 +0000 (17:07 +1100)
commit33c09a4a2109d48b6aa690b4f96d8efd05efa814
treeab63535c2c781d01ca7f3999fd281e1ce780d269
parent28cab94be1a395316a41da24af580cfb38772b93
cgroups: more safe tasklist locking in cgroup_attach_proc

Fix unstable tasklist locking in cgroup_attach_proc.

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@andrew.cmu.edu>
Acked-by: Paul Menage <paul@paulmenage.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/cgroup.c