sched: Don't use possibly stale sched_class
authorThomas Gleixner <tglx@linutronix.de>
Wed, 17 Feb 2010 08:05:48 +0000 (09:05 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 17 Feb 2010 10:58:18 +0000 (11:58 +0100)
commit83ab0aa0d5623d823444db82c3b3c34d7ec364ae
tree7ec14a5e163cb2e17fbfe06b368b4969b78879bd
parent6e40f5bbbc734231bc5809d3eb785e3c21f275d7
sched: Don't use possibly stale sched_class

setscheduler() saves task->sched_class outside of the rq->lock held
region for a check after the setscheduler changes have become
effective. That might result in checking a stale value.

rtmutex_setprio() has the same problem, though it is protected by
p->pi_lock against setscheduler(), but for correctness sake (and to
avoid bad examples) it needs to be fixed as well.

Retrieve task->sched_class inside of the rq->lock held region.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: stable@kernel.org
kernel/sched.c