sched: Protect sched_rr_get_param() access to task->sched_class
authorThomas Gleixner <tglx@linutronix.de>
Wed, 9 Dec 2009 08:32:03 +0000 (09:32 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 9 Dec 2009 09:01:07 +0000 (10:01 +0100)
commitdba091b9e3522b9d32fc9975e48d3b69633b45f0
tree91549e3921971b6d0074fd34c29223b593381c8a
parent3160568371da441b7f2fb57f2f1225404207e8f2
sched: Protect sched_rr_get_param() access to task->sched_class

sched_rr_get_param calls
task->sched_class->get_rr_interval(task) without protection
against a concurrent sched_setscheduler() call which modifies
task->sched_class.

Serialize the access with task_rq_lock(task) and hand the rq
pointer into get_rr_interval() as it's needed at least in the
sched_fair implementation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <alpine.LFD.2.00.0912090930120.3089@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/sched.h
kernel/sched.c
kernel/sched_fair.c
kernel/sched_idletask.c
kernel/sched_rt.c