CVE-2026-31733: sched_ext: Fix stale direct dispatch state in ddsp_dsq_id
In the Linux kernel, the following vulnerability has been resolved:
schedext: Fix stale direct dispatch state in ddspdsqid
@p->scx.ddspdsqid can be left set (non-SCXDSQINVALID) triggering a spurious warning in markdirectdispatch() when the next wakeup's ops.selectcpu() calls scxbpfdsqinsert(), such as:
WARNING: kernel/sched/ext.c:1273 at scxdsqinsertcommit+0xcd/0x140
The root cause is that ddspdsqid was only cleared in dispatchenqueue(), which is not reached in all paths that consume or cancel a direct dispatch verdict.
Fix it by clearing it at the right places:
- directdispatch(): cache the direct dispatch state in local variables and clear it before dispatchenqueue() on the synchronous path. For the deferred path, the direct dispatch state must remain set until processddspdeferredlocals() consumes them.
- processddspdeferredlocals(): cache the dispatch state in local variables and clear it before calling dispatchtolocaldsq(), which may migrate the task to another rq.
- doenqueuetask(): clear the dispatch state on the enqueue path (local/global/bypass fallbacks), where the direct dispatch verdict is ignored.
- dequeuetaskscx(): clear the dispatch state after dispatchdequeue() to handle both the deferred dispatch cancellation and the holdingcpu race, covering all cases where a pending direct dispatch is cancelled.
- scxdisabletask(): clear the direct dispatch state when transitioning a task out of the current scheduler. Waking tasks may have had the direct dispatch state set by the outgoing scheduler's ops.selectcpu() and then been queued on a wakelist via ttwuqueuewakelist(), when SCXOPSALLOWQUEUEDWAKEUP is set. Such tasks are not on the runqueue and are not iterated by scxbypass(), so their direct dispatch state won't be cleared. Without this clear, any subsequent SCX scheduler that tries to direct dispatch the task will trigger the WARNONONCE() in markdirectdispatch().
Affected Software
Remediation
Event History
Frequently Asked Questions
What level of access is required to exploit this issue?
The CVSS vector indicates that exploitation requires local access and low privileges, with no user interaction required.
Which systems are most likely to be exposed?
Systems using the Linux kernel sched_ext scheduler functionality are the relevant population, particularly where an ops.select_cpu() path calls scx_bpf_dsq_insert() and direct dispatch state can be consumed, cancelled, or ignored.
What is the security impact?
The rating is medium with a CVSS 3.1 score of 5.5. The vector identifies high availability impact, with no confidentiality or integrity impact.
How can I identify evidence of the issue?
A symptom is a spurious kernel warning from mark_direct_dispatch(), including a warning at kernel/sched/ext.c:1273 in scx_dsq_insert_commit, when a subsequent wakeup invokes ops.select_cpu() and scx_bpf_dsq_insert().
What should be done if the affected behavior is observed?
A patch is available. Apply the relevant stable kernel fix referenced in the advisory, which clears stale direct-dispatch state on synchronous, deferred, enqueue, and dequeue paths.