Vulnerability · Published May 8, 2025 · Assigned by Linux

CVE-2025-37821sched/eevdf: Fix se->slice being set to U64_MAX and resulting crash

Medium 5.5

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 8% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)5.5Medium
Exploit odds (30 days)0.2%top 91.8% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: sched/eevdf: Fix se->slice being set to U64_MAX and resulting crash There is a code path in dequeue_entities() that can set the slice of a sched_entity to U64_MAX, which sometimes results in a crash. The offending case is when dequeue_entities() is called to dequeue a delayed group entity, and then the entity's parent's dequeue is delayed. In that case: 1. In the if (entity_is_task(se)) else block at the beginning of dequeue_entities(), slice is set to cfs_rq_min_slice(group_cfs_rq(se)). If the entity was delayed, then it has no queued tasks, so cfs_rq_min_slice() returns U64_MAX. 2. The first for_each_sched_entity() loop dequeues the entity. 3. If the entity was its parent's only child, then the next iteration tries to dequeue the parent. 4. If the parent's dequeue needs to be delayed, then it breaks from the first for_each_sched_entity() loop _without updating slice_. 5. The second for_each_sched_entity() loop sets the parent's ->slice to the saved slice, which is still U64_MAX. This throws off subsequent calculations with potentially catastrophic results. A manifestation we saw in production was: 6. In update_entity_lag(), se->slice is used to calculate limit, which ends up as a huge negative number. 7. limit is used in se->vlag = clamp(vlag, -limit, limit). Because limit is negative, vlag > limit, so se->vlag is set to the same huge negative number. 8. In place_entity(), se->vlag is scaled, which overflows and results in another huge (positive or negative) number. 9. The adjusted lag is subtracted from se->vruntime, which increases or decreases se->vruntime by a huge number. 10. pick_eevdf() calls entity_eligible()/vruntime_eligible(), which incorrectly returns false because the vruntime is so far from the other vruntimes on the queue, causing the (vruntime - cfs_rq->min_vruntime) * load calulation to overflow. 11. Nothing appears to be eligible, so pick_eevdf() returns NULL. 12. pick_next_entity() tries to dereference the return value of pick_eevdf() and crashes. Dumping the cfs_rq states from the core dumps with drgn showed tell-tale huge vruntime ranges and bogus vlag values, and I also traced se->slice being set to U64_MAX on live systems (which was usually "benign" since the rest of the runqueue needed to be in a particular state to crash). Fix it in dequeue_entities() by always setting slice from the first non-empty cfs_rq.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:13linux6.12.29-1DEBIAN-CVE-2025-37821
Debian:14linux6.12.29-1DEBIAN-CVE-2025-37821
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2025-37821
Ubuntu:25.10linux-azure-fdeno fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2025-37821
Ubuntu:24.04:LTSlinux-gcp-6.146.14.0-1011.11~24.04.1UBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2025-37821
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-37821
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2025-37821
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2025-37821

Affected products (as reported)

VendorProductVersions
Linux Linux aef6987d89544d63a47753cf3741cabff0b5574c – before 86b37810fa1e40b93171da023070b99ccbb4ea04aef6987d89544d63a47753cf3741cabff0b5574c – before 50a665496881262519f115f1bfe5822f30580eb0aef6987d89544d63a47753cf3741cabff0b5574c – before bbce3de72be56e4b5f68924b7da9630cc89aa1a8
Linux Linux 6.12

References