{"id":"CVE-2026-31733","aliases":["CVE-2026-31733"],"related":[],"kind":"vulnerability","state":"published","title":"sched_ext: Fix stale direct dispatch state in ddsp_dsq_id","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nsched_ext: Fix stale direct dispatch state in ddsp_dsq_id\n\n@p->scx.ddsp_dsq_id can be left set (non-SCX_DSQ_INVALID) triggering a\nspurious warning in mark_direct_dispatch() when the next wakeup's\nops.select_cpu() calls scx_bpf_dsq_insert(), such as:\n\n WARNING: kernel/sched/ext.c:1273 at scx_dsq_insert_commit+0xcd/0x140\n\nThe root cause is that ddsp_dsq_id was only cleared in dispatch_enqueue(),\nwhich is not reached in all paths that consume or cancel a direct dispatch\nverdict.\n\nFix it by clearing it at the right places:\n\n - direct_dispatch(): cache the direct dispatch state in local variables\n   and clear it before dispatch_enqueue() on the synchronous path. For\n   the deferred path, the direct dispatch state must remain set until\n   process_ddsp_deferred_locals() consumes them.\n\n - process_ddsp_deferred_locals(): cache the dispatch state in local\n   variables and clear it before calling dispatch_to_local_dsq(), which\n   may migrate the task to another rq.\n\n - do_enqueue_task(): clear the dispatch state on the enqueue path\n   (local/global/bypass fallbacks), where the direct dispatch verdict is\n   ignored.\n\n - dequeue_task_scx(): clear the dispatch state after dispatch_dequeue()\n   to handle both the deferred dispatch cancellation and the holding_cpu\n   race, covering all cases where a pending direct dispatch is\n   cancelled.\n\n - scx_disable_task(): clear the direct dispatch state when\n   transitioning a task out of the current scheduler. Waking tasks may\n   have had the direct dispatch state set by the outgoing scheduler's\n   ops.select_cpu() and then been queued on a wake_list via\n   ttwu_queue_wakelist(), when SCX_OPS_ALLOW_QUEUED_WAKEUP is set. Such\n   tasks are not on the runqueue and are not iterated by scx_bypass(),\n   so their direct dispatch state won't be cleared. Without this clear,\n   any subsequent SCX scheduler that tries to direct dispatch the task\n   will trigger the WARN_ON_ONCE() in mark_direct_dispatch().","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nsched_ext: Fix stale direct dispatch state in ddsp_dsq_id\n\n@p->scx.ddsp_dsq_id can be left set (non-SCX_DSQ_INVALID) triggering a\nspurious warning in mark_direct_dispatch() when the next wakeup's\nops.select_cpu() calls scx_bpf_dsq_insert(), such as:\n\n WARNING: kernel/sched/ext.c:1273 at scx_dsq_insert_commit+0xcd/0x140\n\nThe root cause is that ddsp_dsq_id was only cleared in dispatch_enqueue(),\nwhich is not reached in all paths that consume or cancel a direct dispatch\nverdict.\n\nFix it by clearing it at the right places:\n\n - direct_dispatch(): cache the direct dispatch state in local variables\n   and clear it before dispatch_enqueue() on the synchronous path. For\n   the deferred path, the direct dispatch state must remain set until\n   process_ddsp_deferred_locals() consumes them.\n\n - process_ddsp_deferred_locals(): cache the dispatch state in local\n   variables and clear it before calling dispatch_to_local_dsq(), which\n   may migrate the task to another rq.\n\n - do_enqueue_task(): clear the dispatch state on the enqueue path\n   (local/global/bypass fallbacks), where the direct dispatch verdict is\n   ignored.\n\n - dequeue_task_scx(): clear the dispatch state after dispatch_dequeue()\n   to handle both the deferred dispatch cancellation and the holding_cpu\n   race, covering all cases where a pending direct dispatch is\n   cancelled.\n\n - scx_disable_task(): clear the direct dispatch state when\n   transitioning a task out of the current scheduler. Waking tasks may\n   have had the direct dispatch state set by the outgoing scheduler's\n   ops.select_cpu() and then been queued on a wake_list via\n   ttwu_queue_wakelist(), when SCX_OPS_ALLOW_QUEUED_WAKEUP is set. Such\n   tasks are not on the runqueue and are not iterated by scx_bypass(),\n   so their direct dispatch state won't be cleared. Without this clear,\n   any subsequent SCX scheduler that tries to direct dispatch the task\n   will trigger the WARN_ON_ONCE() in mark_direct_dispatch().","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nsched_ext: Corrige el estado obsoleto de despacho directo en ddsp_dsq_id\n\n@p  ->  scx.ddsp_dsq_id puede quedar establecido (no-SCX_DSQ_INVALID) desencadenando una advertencia espuria en mark_direct_dispatch() cuando el ops.select_cpu() de la siguiente activación llama a scx_bpf_dsq_insert(), como por ejemplo:\n\n ADVERTENCIA: kernel/sched/ext.c:1273 en scx_dsq_insert_commit+0xcd/0x140\n\nLa causa raíz es que ddsp_dsq_id solo se borraba en dispatch_enqueue(), que no se alcanza en todas las rutas que consumen o cancelan un veredicto de despacho directo.\n\nCorrígelo borrándolo en los lugares correctos:\n\n - direct_dispatch(): almacena en caché el estado de despacho directo en variables locales y bórralo antes de dispatch_enqueue() en la ruta síncrona. Para la ruta diferida, el estado de despacho directo debe permanecer establecido hasta que process_ddsp_deferred_locals() los consuma.\n\n - process_ddsp_deferred_locals(): almacena en caché el estado de despacho en variables locales y bórralo antes de llamar a dispatch_to_local_dsq(), lo que puede migrar la tarea a otra rq.\n\n - do_enqueue_task(): borra el estado de despacho en la ruta de encolamiento (alternativas local/global/bypass), donde el veredicto de despacho directo es ignorado.\n\n - dequeue_task_scx(): borra el estado de despacho después de dispatch_dequeue() para manejar tanto la cancelación de despacho diferido como la condición de carrera holding_cpu, cubriendo todos los casos en los que se cancela un despacho directo pendiente.\n\n - scx_disable_task(): borra el estado de despacho directo al hacer la transición de una tarea fuera del planificador actual. Las tareas que se activan pueden haber tenido el estado de despacho directo establecido por el ops.select_cpu() del planificador saliente y luego haber sido encoladas en una wake_list a través de ttwu_queue_wakelist(), cuando SCX_OPS_ALLOW_QUEUED_WAKEUP está establecido. Dichas tareas no están en la runqueue y no son iteradas por scx_bypass(), por lo que su estado de despacho directo no se borrará. Sin este borrado, cualquier planificador SCX subsiguiente que intente despachar directamente la tarea activará el WARN_ON_ONCE() en mark_direct_dispatch().","source":"nvd"}],"published":"2026-05-01T14:14:31.558Z","modified":"2026-11-11T21:10:00.200Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"5b26f7b920f76b2b9cc398c252a9e35e44bf5bb9","fixed":"ca685511f7afd42cdcbb0feea42e5d332d384251","status":"affected"},{"type":"git","introduced":"5b26f7b920f76b2b9cc398c252a9e35e44bf5bb9","fixed":"5e7b2cc8fae9ec2a5bc53311191d2faaff75a4b5","status":"affected"},{"type":"git","introduced":"5b26f7b920f76b2b9cc398c252a9e35e44bf5bb9","fixed":"7ea601daa0153e19cd1c6e6b300348c70c05fe77","status":"affected"},{"type":"git","introduced":"5b26f7b920f76b2b9cc398c252a9e35e44bf5bb9","fixed":"7e0ffb72de8aa3b25989c2d980e81b829c577010","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.12","status":"unaffected"},{"type":"semver","introduced":"6.12.82","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.22","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.12","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.12","fixed":"6.12.82"},{"status":"affected","introduced":"6.13","fixed":"6.18.22"},{"status":"affected","introduced":"6.19","fixed":"6.19.12"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/ca685511f7afd42cdcbb0feea42e5d332d384251","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5e7b2cc8fae9ec2a5bc53311191d2faaff75a4b5","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7ea601daa0153e19cd1c6e6b300348c70c05fe77","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7e0ffb72de8aa3b25989c2d980e81b829c577010","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31733","url":"https://www.cve.org/CVERecord?id=CVE-2026-31733","licence":"CVE Terms of Use","modified":"2026-05-11T22:14:42.580Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31733","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31733","licence":"Public domain","modified":"2026-11-11T21:10:00.200Z"}],"updatedAt":"2026-11-25T22:59:20.357Z","epss":{"score":0.00135,"percentile":0.03182,"date":"2026-12-01T12:00:22.000Z"}}