Cloudanix VulnDB

CVE-2024-57951

High · 7.8

CVSS

7.8

EPSS

0.3%

Published

Feb 12, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A Linux kernel bug can leave timer data in a bad state after CPU changes, letting a local attacker crash the system or potentially take control.

Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
Low
Impact
Full Compromise
Component
OS kernel
Class
Use After Free
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The flaw fails to reset per-CPU hrtimer state (including hres_active and online flags) on certain hotplug round-trips, leaving dangling pointers that can result in use-after-free conditions when timers are later enqueued.

Why it matters to the business

Linux systems performing CPU hotplug may suffer kernel instability, crashes, or local privilege escalation, increasing operational risk on servers and cloud instances that rely on dynamic CPU management.

How an attack unfolds

An attacker with local access repeatedly cycles a CPU through online and partial hot-unplug states to trigger the stale hrtimer CPU base, then triggers timer enqueue operations that dereference invalid pointers, enabling use-after-free exploitation.

How to fix it

Upgrade the Linux kernel to a version containing commit 8fe28cb58bcb235034b64cbbb7550a8a43fd88be or later; rebuild and reboot with the updated kernel image.

How to confirm the fix worked

Confirm the startup() callback exists in kernel/time/hrtimer.c and that cpu_base.online is correctly set after hotplug; run targeted CPU hotplug stress tests to verify absence of WARN_ON_ONCE in enqueue_hrtimer.

Typical attack path

  1. Obtain local user access on the target system
  2. Trigger repeated CPU hotplug offline/online transitions
  3. Force timer enqueue operations that hit the stale per-CPU state
  4. Exploit resulting use-after-free for code execution or denial of service

How to detect it

Search kernel logs for WARN_ON_ONCE messages from enqueue_hrtimer during CPU hotplug events and monitor for use-after-free crashes or slab corruption in hrtimer-related structures.

What your security team should do

  • Apply the referenced kernel commit or distribution backport immediately on all affected systems
  • Prioritize patching servers that perform frequent CPU hotplug or live migration
  • Enable kernel hardening features such as KASAN and lockdep during testing of the fix

The record

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 ]

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 linux 0 No fix
Debian:11 linux 0 5.10.234-1
Debian:11 linux-6.1 0 6.1.128-1~deb11u1
Debian:11 linux-6.1 0 6.1.6.1.128-1~deb11u1
Debian:12 linux 0 6.1.128-1
Debian:13 linux 0 6.12.11-1
Linux Kernel 0 5.4.290
openSUSE:Leap 16.0 dtb-aarch64 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-64kb 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-default 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-default-base 0 6.12.0-160000.6.1.160000.2.4
openSUSE:Leap 16.0 kernel-docs 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-kvmsmall 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-obs-build 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-obs-qa 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-rt 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-source 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-syms 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-zfcpdump 0 6.12.0-160000.6.1

Related vulnerabilities