# CVE-2025-21897: sched\_ext: Fix pick\_task\_scx() picking non-queued tasks when it's called without balance()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.21% (percentile 7, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-04-01T15:26:49.705Z
- **Modified:** 2026-06-17T08:44:33.420Z

## Who should check

- Anyone running Linux \>= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, \< 5324c459f90d16b0c43a78b494c598915d782b7a; \>= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, \< de60a31cb0bcacfaf9487546eac5e70e0a9c66d7; \>= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, \< 8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5
- Anyone running Linux 6.12

## 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.

## Affected and fixed versions

- Linux: \>= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, \< 5324c459f90d16b0c43a78b494c598915d782b7a; \>= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, \< de60a31cb0bcacfaf9487546eac5e70e0a9c66d7; \>= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, \< 8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5 (cvelist)
- Linux: 6.12 (cvelist)

## Mitigation

- Upgrade Linux to 8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-21897. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21897.md
Affected: Linux >= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, < 5324c459f90d16b0c43a78b494c598915d782b7a; >= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, < de60a31cb0bcacfaf9487546eac5e70e0a9c66d7; >= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, < 8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5; Linux 6.12
Fixed in: Linux 5324c459f90d16b0c43a78b494c598915d782b7a, Linux 8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-21897 being exploited?

There is no confirmed exploitation: CVE-2025-21897 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.21% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-21897?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-21897?

Linux \>= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, \< 5324c459f90d16b0c43a78b494c598915d782b7a; \>= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, \< de60a31cb0bcacfaf9487546eac5e70e0a9c66d7; \>= a6250aa251eacaf3ebfcfe152a96a727fd483ecd, \< 8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5; Linux 6.12.

### Is there a fix for CVE-2025-21897?

Yes. Fixed in Linux 5324c459f90d16b0c43a78b494c598915d782b7a, Linux 8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5. Upgrade Linux to 8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5 or later.

### How do I check if I'm affected by CVE-2025-21897?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/5324c459f90d16b0c43a78b494c598915d782b7a>
- patch: <https://git.kernel.org/stable/c/de60a31cb0bcacfaf9487546eac5e70e0a9c66d7>
- patch: <https://git.kernel.org/stable/c/8fef0a3b17bb258130a4fcbcb5addf94b25e9ec5>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-21897>

HTML: <https://flawdb.com/CVE-2025-21897> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-21897>
