]> 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, 5 Oct 2011 07:56:05 +0000 (18:56 +1100)
commit5893cd5bf6d0d35dc9959021458b40f702bbcbef
treefea96c3462cb594648fe94b684e9aa8d9c773676
parent80c44dfafbe85b2485274ed77d22efd84fe62997
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