CVE-2025-39736: mm/kmemleak: avoid deadlock by moving pr_warn() outside kmemleak_lock
In the Linux kernel, the following vulnerability has been resolved:
mm/kmemleak: avoid deadlock by moving prwarn() outside kmemleaklock
When netpoll is enabled, calling prwarnonce() while holding kmemleaklock in mempoolalloc() can cause a deadlock due to lock inversion with the netconsole subsystem. This occurs because prwarnonce() may trigger netpoll, which eventually leads to allocskb() and back into kmemleak code, attempting to reacquire kmemleaklock.
This is the path for the deadlock.
mempoolalloc() -> rawspinlockirqsave(&kmemleaklock, flags); -> prwarnonce() -> netconsole subsystem -> netpoll -> allocskb -> createobject -> rawspinlockirqsave(&kmemleaklock, flags);
Fix this by setting a flag and issuing the prwarnonce() after kmemleaklock is released.
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
In mm/kmemleak, set a flag while handling the warning and issue pr_warn_once() only after kmemleak_lock has been released, preventing the netpoll/netconsole lock inversion deadlock.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-39736?
CVE-2025-39736 has been classified with a medium severity level due to its potential to cause deadlocks in the Linux kernel.
How do I fix CVE-2025-39736?
To fix CVE-2025-39736, ensure you apply the latest patches released for the Linux kernel that address this vulnerability.
What software is affected by CVE-2025-39736?
CVE-2025-39736 affects the Linux kernel, specifically in scenarios where netpoll is enabled.
What kind of attacks can exploit CVE-2025-39736?
CVE-2025-39736 can be exploited to cause a deadlock, potentially leading to denial of service under specific conditions.
When was CVE-2025-39736 published?
CVE-2025-39736 was published recently as part of ongoing security improvements in the Linux kernel.