CVE-2025-39737: mm/kmemleak: avoid soft lockup in __kmemleak_do_cleanup()
In the Linux kernel, the following vulnerability has been resolved:
mm/kmemleak: avoid soft lockup in kmemleakdocleanup()
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 CONFIGDEBUGKMEMLEAKMEMPOOLSIZE set to 40,000.
The soft lockup happened in kmemleakdocleanup() 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 rawspinlock has to be acquired and released in deleteobject(), 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 condresched() at periodic interval in the iteration loop to avoid soft lockup.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1 - Compensating control
Add cond_resched() at periodic intervals in the __kmemleak_do_cleanup() iteration loop to prevent soft lockups while processing kmemleak objects.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-39737?
CVE-2025-39737 has been classified with a moderate severity level due to the potential for system performance issues.
How does CVE-2025-39737 affect the Linux kernel?
CVE-2025-39737 causes a soft lockup when running a debug kernel with kmemleak enabled on systems with limited memory.
How can I mitigate the effects of CVE-2025-39737?
To mitigate CVE-2025-39737, consider updating to the latest version of the Linux kernel where the vulnerability has been addressed.
What systems are impacted by CVE-2025-39737?
CVE-2025-39737 primarily impacts small x86-64 systems with 16 GB of RAM running a debug kernel.
Is there a known fix for CVE-2025-39737?
Yes, the fix for CVE-2025-39737 is included in the recent updates of the Linux kernel.