CVE-2026-142831: sched_ext: Don't leave balance callbacks queued across a pick retry
In the Linux kernel, the following vulnerability has been resolved:
schedext: Don't leave balance callbacks queued across a pick retry
The dispatch path can request deferred work to be run from a balance callback and picktaskscx() queues rq->scx.deferredbalcb right after dispatching. However, a balance callback must be consumed before the rq lock is released and picktaskscx() is not necessarily the end of the pick:
- it returns RETRYTASK when a higher priority class task has been enqueued while the dispatch had the rq lock released;
- the dlserver pick can return NULL, in which case the lower classes are picked next.
In both cases the callback stays queued while the core keeps picking, and the rq lock can be released again, either by prevbalance() or by another dispatch. For example, with an RT task as prev:
schedule() picknexttask() picktaskscx() dispatchpick() maybequeuebalancecallback() <- deferredbalcb queued return RETRYTASK prevbalance() balancert() pullrttask() doublelockbalance() <- rq lock released
Any CPU acquiring the rq lock in that window finds a pending balance callback and triggers the following warning in rqpinlock():
WARNING: kernel/sched/sched.h:1919 at rqlock+0x7f/0xe0, CPU#10: stress-ng-sleep/533 CPU: 10 UID: 0 PID: 533 Comm: stress-ng-sleep Not tainted 7.2.0-rc6-virtme #61 PREEMPT(full) Schedext: qmap (enabled+all) Call Trace: <IRQ> trytowakeup+0x2c1/0x5c0 hrtimerwakeup+0x22/0x30 hrtimerrunqueues+0x1d5/0x350 hrtimerinterrupt+0x106/0x1e0 sysvecapictimerinterrupt+0x6f/0x210 sysvecapictimerinterrupt+0x71/0x90 </IRQ>
This can be reproduced running scxqmap -I together with a SCHEDFIFO workload that frequently sleeps, e.g.:
$ vng -v --cpus 16 --memory 4G -- \ 'tools/schedext/build/bin/scxqmap -I >/dev/null & \ stress-ng --sleep 4 --sched fifo --sched-prio 1 -t 30 -q'
Fix this by queueing the balance callbacks only when the pick is final. Otherwise, defer the pending work to the irqwork path, which doesn't depend on the current rq lock section, and leave the kick sync wait pending for the next pick.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Compensating control
Queue balance callbacks only when the task pick is final; otherwise defer pending work to the irq_work path so callbacks are not left queued across a pick retry.
Event History
Frequently Asked Questions
What scheduler activity is required to trigger the issue?
The sched_ext dispatch path must queue deferred work as a balance callback, then task selection must continue after pick_task_scx() returns RETRY_TASK because a higher-priority task was enqueued, or because the deadline-server pick returns NULL. The runqueue lock must then be released again while the callback remains queued.
Can a higher-priority real-time task contribute to the trigger?
Yes. The described example has an RT task as the previous task: sched_ext queues the deferred balance callback, returns RETRY_TASK, and prev_balance() reaches RT balancing, where double_lock_balance() releases the runqueue lock.
How can this condition be identified at runtime?
A CPU acquiring the affected runqueue lock while the balance callback is still pending triggers a warning in rq_pin_lock(). This warning is the runtime symptom described for the stale queued callback.