capabilities: Use RCU to protect task lookup in sys_capget
authorThomas Gleixner <tglx@linutronix.de>
Wed, 9 Dec 2009 16:13:31 +0000 (17:13 +0100)
committerJames Morris <jmorris@namei.org>
Wed, 9 Dec 2009 22:42:48 +0000 (09:42 +1100)
cap_get_target_pid() protects the task lookup with tasklist_lock.
security_capget() is called under tasklist_lock as well but
tasklist_lock does not protect anything there. The capabilities are
protected by RCU already.

So tasklist_lock only protects the lookup and prevents the task going
away, which can be done with rcu_read_lock() as well.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: James Morris <jmorris@namei.org>
kernel/capability.c

Simple merge