]> 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>
Wed, 12 Oct 2011 06:32:28 +0000 (17:32 +1100)
commit394e74f5838406480ea48da88d5b32e0bc349766
treeb43e61be904f11fcb492c701a896301d404399b8
parent710dc33deec0f682f778828653c6289c521975ab
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