Skip to content
  • Thomas Gleixner's avatar
    sched: Don't use possibly stale sched_class · 83ab0aa0
    Thomas Gleixner authored
    
    
    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: default avatarThomas Gleixner <tglx@linutronix.de>
    Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
    Cc: stable@kernel.org
    83ab0aa0