]> 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>
Mon, 24 Oct 2011 14:59:54 +0000 (01:59 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 25 Oct 2011 09:08:12 +0000 (20:08 +1100)
commit119d1fbd3f6f545382a9c43f6f1ad02d8dfba042
tree8b5670c8b33ab55c03bdf16bdfc04823e3f9e109
parent533175d9f52d5d7f3f30f6a028abfac7b950100c
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