]> 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, 14 Oct 2011 06:34:21 +0000 (17:34 +1100)
commit96b416333a6377c07eec115e461277c697ee9e62
tree0edc3939e7b49ee5647d353d91622ef588ffacd4
parent5fffdb3baf25c5826f127af3b51af29efc658db4
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