CVE-2025-21897 Details
Description
In the Linux kernel, the following vulnerability has been resolved: sched_ext: Fix pick_task_scx() picking non-queued tasks when it's called without balance() a6250aa251ea ("sched_ext: Handle cases where pick_task_scx() is called without preceding balance_scx()") added a workaround to handle the cases where pick_task_scx() is called without prececing balance_scx() which is due to a fair class bug where pick_taks_fair() may return NULL after a true return from balance_fair(). The workaround detects when pick_task_scx() is called without preceding balance_scx() and emulates SCX_RQ_BAL_KEEP and triggers kicking to avoid stalling. Unfortunately, the workaround code was testing whether @prev was on SCX to decide whether to keep the task running. This is incorrect as the task may be on SCX but no longer runnable. This could lead to a non-runnable task to be returned from pick_task_scx() which cause interesting confusions and failures. e.g. A common failure mode is the task ending up with (!on_rq && on_cpu) state which can cause potential wakers to busy loop, which can easily lead to deadlocks. Fix it by testing whether @prev has SCX_TASK_QUEUED set. This makes @prev_on_scx only used in one place. Open code the usage and improve the comment while at it.
A vulnerability in the Linux kernel's fair scheduling component can lead to improper task management. The issue arises in the 'sched_ext' scheduler, where the 'pick_task_scx()' function may select tasks that are not queued, particularly when called without a prior 'balance_scx()' operation. This problem stems from a bug in the fair scheduling class, where 'pick_task_fair()' can return NULL after a valid 'balance_fair()' call. The introduced workaround attempts to address this by detecting unbalanced calls and emulating a balance state, but it incorrectly relies on the task's SCX status to determine if it should remain active. This misjudgment can result in a non-runnable task being returned, creating confusion and potential failures, such as a task being in an 'on_cpu' state without being on the run queue, which can cause busy-waiting and lead to deadlocks.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
No SSVC data is available for this CVE.
References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://git.kernel.org/stable/c/5324c459f90d16b0c43a78b494c598915d782b7a | kernel.org | Patch |
| https://git.kernel.org/stable/c/8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5 | kernel.org | Patch |
| https://git.kernel.org/stable/c/de60a31cb0bcacfaf9487546eac5e70e0a9c66d7 | kernel.org | Patch |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-667 | Improper Locking | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| linux linux kernel | >= 6.12.1, < 6.12.18 >= 6.13, < 6.13.6 6.12 - 6.14 rc1 6.14 rc2 6.14 rc3 6.14 rc4 |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | kernel.org |
| Oct 31, 2025 | Initial Analysis | [email protected] |
| Apr 1, 2025 | New CVE Received | kernel.org |