Cyber Posture

CVE-2024-57951

High

Published: 12 February 2025

Published
12 February 2025
Modified
03 November 2025
KEV Added
Patch
CVSS Score 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.0001 2.0th percentile
Risk Priority 16 60% EPSS · 20% KEV · 20% CVSS

Description

In the Linux kernel, the following vulnerability has been resolved: hrtimers: Handle CPU state correctly on hotplug Consider a scenario where a CPU transitions from CPUHP_ONLINE to halfway through a CPU hotunplug down to CPUHP_HRTIMERS_PREPARE, and then back to CPUHP_ONLINE: Since hrtimers_prepare_cpu() does not run, cpu_base.hres_active remains set to 1 throughout. However, during a CPU unplug operation, the tick and the clockevents are shut down at CPUHP_AP_TICK_DYING. On return to the online state, for instance CFS incorrectly assumes that the hrtick is already active, and the chance of the clockevent device to transition to oneshot mode is also lost forever for the CPU, unless it goes back to a lower state than CPUHP_HRTIMERS_PREPARE once. This round-trip reveals another issue; cpu_base.online is not set to 1 after the transition, which appears as a WARN_ON_ONCE in enqueue_hrtimer(). Aside of that, the bulk of the per CPU state is not reset either, which means there are dangling pointers in the worst case. Address this by adding a corresponding startup() callback, which resets the stale per CPU state and sets the online flag. [ tglx: Make the new callback unconditionally available, remove the online modification in the prepare() callback and clear the remaining state in the starting callback instead of the prepare callback ]

Security Summary

CVE-2024-57951 is a vulnerability in the Linux kernel's hrtimers subsystem during CPU hotplug operations. It occurs when a CPU transitions from the CPUHP_ONLINE state partway through a hotunplug process to CPUHP_HRTIMERS_PREPARE and then back to CPUHP_ONLINE. In this scenario, hrtimers_prepare_cpu() does not execute, leaving cpu_base.hres_active set to 1. The tick and clockevents shut down at CPUHP_AP_TICK_DYING, causing issues like the Completely Fair Scheduler (CFS) incorrectly assuming hrtick is active, permanent loss of oneshot mode for the clockevent device unless the CPU reaches a lower state, cpu_base.online not being set (triggering a WARN_ON_ONCE in enqueue_hrtimer()), and unreset per-CPU state potentially leading to dangling pointers. This corresponds to CWE-416 (Use After Free) with a CVSS v3.1 base score of 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

A local attacker with low privileges can exploit this vulnerability by triggering the specific CPU hotplug state transitions. Successful exploitation could result in high-impact confidentiality, integrity, and availability violations, such as system crashes from WARN_ON_ONCE triggers, incorrect scheduler behavior, or memory corruption via dangling pointers in per-CPU state.

The provided references are kernel stable commit patches that address the issue. These include adding a startup() callback to unconditionally reset stale per-CPU state and set the cpu_base.online flag, removing online modifications from the prepare() callback, and clearing remaining state in the starting callback. Applying these patches to affected Linux kernels mitigates the vulnerability.

Details

CWE(s)
CWE-416

Affected Products

linux
linux kernel
6.13 · 4.19.302 — 4.20 · 5.4.264 — 5.4.290 · 5.10.204 — 5.10.234

References