Cloudanix VulnDB

CVE-2025-39737

Medium · 5.5

CVSS

5.5

EPSS

0.2%

Published

Sep 11, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in the Linux kernel's memory debugging tool could make the system appear frozen for tens of seconds when cleaning up many tracked objects, potentially triggering automatic reboots on servers and devices.

Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
Low
Impact
Denial Of Service
Component
OS kernel
Class
Denial of service
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The vulnerability permits a soft lockup in the kmemleak object cleanup loop within __kmemleak_do_cleanup() when processing tens of thousands of objects under debug kernel configurations with CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE set low, because the loop acquires and releases a raw_spinlock per object without periodic rescheduling.

Why it matters to the business

Systems running affected Linux kernels with kmemleak enabled may experience watchdog-triggered soft lockups during memory hot-unplug or high object-count scenarios, leading to temporary unresponsiveness or forced reboots on servers and embedded devices.

How an attack unfolds

An attacker or workload triggers kmemleak to disable itself due to allocation failure, after which the subsequent workqueue-driven cleanup of at least 40,000 objects on a debug kernel without cond_resched() calls causes the CPU to remain stuck long enough for the soft lockup watchdog to fire.

How to fix it

Upgrade to a kernel containing commit 9f1f4e95031f84867c5821540466d62f88dab8ca or later; for packaged distributions apply the corresponding fixed version such as configmap-reload-fips-0.11.1-r18; consider disabling CONFIG_DEBUG_KMEMLEAK on production systems where feasible.

How to confirm the fix worked

Confirm kernel git commit or package version contains the referenced fix; reproduce the original workload with kmemleak enabled and verify absence of soft lockup warnings in dmesg; run kmemleak self-tests under memory pressure.

Typical attack path

  1. Enable kmemleak on a debug kernel with limited object pool
  2. Generate sufficient kmemleak-tracked objects (e.g., via memory pressure or device hot-unplug)
  3. Force kmemleak to disable itself
  4. Observe workqueue thread stuck in __delete_object() loop without yielding

How to detect it

Search kernel logs (dmesg, journalctl) for soft lockup warnings containing kworker threads and references to kmemleak_do_cleanup or __delete_object; correlate with kmemleak disablement messages and memory hot-unplug events.

  • BUG: soft lockup - CPU#.* stuck for .*s! \[kworker/.*:.*\]
  • kmemleak_do_cleanup
  • __delete_object
  • kmemleak disabled

What your security team should do

  • Apply the fixed kernel commit or package update immediately on all systems using kmemleak debug builds
  • Audit production kernels and disable CONFIG_DEBUG_KMEMLEAK unless required for diagnostics
  • Monitor for soft lockup messages in system logs on affected hosts
  • Prioritize patching systems with frequent device hot-unplug or high memory churn

The record

In the Linux kernel, the following vulnerability has been resolved: mm/kmemleak: avoid soft lockup in __kmemleak_do_cleanup() A soft lockup warning was observed on a relative small system x86-64 system with 16 GB of memory when running a debug kernel with kmemleak enabled. watchdog: BUG: soft lockup - CPU#8 stuck for 33s! [kworker/8:1:134] The test system was running a workload with hot unplug happening in parallel. Then kemleak decided to disable itself due to its inability to allocate more kmemleak objects. The debug kernel has its CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE set to 40,000. The soft lockup happened in kmemleak_do_cleanup() when the existing kmemleak objects were being removed and deleted one-by-one in a loop via a workqueue. In this particular case, there are at least 40,000 objects that need to be processed and given the slowness of a debug kernel and the fact that a raw_spinlock has to be acquired and released in __delete_object(), it could take a while to properly handle all these objects. As kmemleak has been disabled in this case, the object removal and deletion process can be further optimized as locking isn't really needed. However, it is probably not worth the effort to optimize for such an edge case that should rarely happen. So the simple solution is to call cond_resched() at periodic interval in the iteration loop to avoid soft lockup.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 linux 0 No fix
Debian:12 linux 0 No fix
Debian:13 linux 0 6.12.43-1
Debian:14 linux 0 6.16.3-1
Linux Kernel 0 5.4.297
Linux Kernel 5.4.0 5.4.297

Related vulnerabilities