CVE-2026-143085: sched_ext: Fix stale pick when the donor changes during dispatch
In the Linux kernel, the following vulnerability has been resolved:
schedext: Fix stale pick when the donor changes during dispatch
Dispatch takes rq->donor as @prev and can drop the rq lock. With proxy execution, @prev may not be the running task, and another CPU can reset the donor to rq->curr meanwhile, through proxyneedsreturn() on a wakeup or schedproxyblocktask() on a class or scheduler change. The wakeup case:
1. dispatchone() drops the rq lock, e.g. to move a task from another CPU. 2. Another CPU wakes the donor, which proxy execution migrated to this CPU. proxyneedsreturn() dequeues it and resets the donor to rq->curr, and the wakeup enqueues it, possibly on another CPU. 3. dispatchone() sees @prev queued and returns SCXDSPPREV. 4. dopicktaskscx() returns @prev, and this CPU runs a task that is queued on another rq.
Under core scheduling, the core pick runs dispatch for the sibling rqs with each sibling's donor as @prev, and a sibling can switch @prev out while dispatch has the lock dropped.
Whatever dispatch concluded, and whatever it does with @prev after the drop, is about a task the rq no longer owns, whether it keeps @prev running or hands it to ops.dispatch().
rqmodifiedabove() catches the change only when rq->curr is in a class above ext, and the dlserver pick skips that check. dispatchcorepick() retries after a lock drop, but by then dispatch has used @prev.
Restart the pick when @prev is no longer the donor. dispatchone() tests after each step that can drop the lock, and scxdispatchsched() decides per ops.dispatch() call whether to hand @prev over, which also covers a class or scheduler change across a drop.
With proxy execution alone, the donor only ever changes to rq->curr during a pick, so the retried pick can't go stale again. Under core scheduling, the restart goes through the core pick, which already retries after any lock drop.
7a3a6bfbd62a ("sched: Rework prevbalance() to avoid stale prev references") closed the same window in prevbalance() by reading rq->donor instead of taking @prev. That doesn't work here, as dispatch never evaluated the new donor, which may not even be a schedext task.
Verified with synthetic reproducers for both cases.
v2: Also cover rq lock drops inside dispatch (sashiko).
v3: Don't keep a stale @prev after ops.dispatch() (sashiko).
v4: Also cover a sibling switching @prev out under core scheduling. Retitle.
Affected Software
Event History
Frequently Asked Questions
Which scheduler configurations are implicated by the described race?
The race is described in sched_ext when proxy execution is in use and dispatch drops the runqueue lock. Core scheduling is also specifically implicated because dispatch can run for sibling runqueues while a sibling changes the donor task.
What condition leads to an invalid task selection?
After dispatch drops the runqueue lock, another CPU can reset the donor to the current task and enqueue the former donor elsewhere. Dispatch may then treat the stale donor as the previous task and select a task that is queued on another runqueue.
What fixes are referenced for this issue?
The provided references identify stable commits b88438530ee3978b1d3f24576c4f508be2b30b82 and 9ce6fca02867911ba79bc3664219effe8c7be8f4. The available data does not map these commits to specific Linux kernel release versions.