sched: Use rcu in sys_sched_getscheduler/sys_sched_getparam()
commitd99be10f68ad49e067e515b53970d53e37ea8b15
authorThomas Gleixner <tglx@linutronix.de>
Wed, 9 Dec 2009 10:14:58 +0000 (9 10:14 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:17:59 +0000 (20 13:17 -0700)
tree8d04b454585f4c84d1ef6870e87997a42943afca
parentad6899b37b13b669b2c52d1a86827d62459760a4
sched: Use rcu in sys_sched_getscheduler/sys_sched_getparam()

commit 5fe85be081edf0ac92d83f9c39e0ab5c1371eb82 upstream

read_lock(&tasklist_lock) does not protect
sys_sched_getscheduler and sys_sched_getparam() against a
concurrent update of the policy or scheduler parameters as
do_sched_setscheduler() does not take the tasklist_lock. The
accessed integers can be retrieved w/o locking and are snapshots
anyway.

Using rcu_read_lock() to protect find_task_by_vpid() and prevent
the task struct from going away is not changing the above
situation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20091209100706.753790977@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/sched.c