Skip to main content

CVE-2025-37989: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2025-37989cvecve-2025-37989
Published: Tue May 20 2025 (05/20/2025, 17:09:21 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net: phy: leds: fix memory leak A network restart test on a router led to an out-of-memory condition, which was traced to a memory leak in the PHY LED trigger code. The root cause is misuse of the devm API. The registration function (phy_led_triggers_register) is called from phy_attach_direct, not phy_probe, and the unregister function (phy_led_triggers_unregister) is called from phy_detach, not phy_remove. This means the register and unregister functions can be called multiple times for the same PHY device, but devm-allocated memory is not freed until the driver is unbound. This also prevents kmemleak from detecting the leak, as the devm API internally stores the allocated pointer. Fix this by replacing devm_kzalloc/devm_kcalloc with standard kzalloc/kcalloc, and add the corresponding kfree calls in the unregister path.

AI-Powered Analysis

AILast updated: 07/03/2025, 19:26:22 UTC

Technical Analysis

CVE-2025-37989 is a memory leak vulnerability identified in the Linux kernel's PHY LED trigger subsystem. The issue arises from improper use of the device-managed (devm) memory allocation API within the PHY LED trigger code. Specifically, the registration function phy_led_triggers_register is invoked from phy_attach_direct rather than phy_probe, and the corresponding unregister function phy_led_triggers_unregister is called from phy_detach instead of phy_remove. This leads to multiple invocations of register and unregister functions for the same PHY device without properly freeing the devm-allocated memory, which is only released when the driver is unbound. Consequently, this results in a memory leak that can cause an out-of-memory condition during network restart tests on routers. The devm API's internal pointer storage also prevents detection of this leak by kmemleak tools. The fix involves replacing devm_kzalloc/devm_kcalloc calls with standard kzalloc/kcalloc and adding explicit kfree calls in the unregister path to ensure proper memory deallocation. This vulnerability affects the Linux kernel versions identified by the commit hash 2e0bc452f4721520502575362a9cd3c1248d2337 and was published on May 20, 2025. No known exploits are reported in the wild as of now, and no CVSS score has been assigned.

Potential Impact

For European organizations, this vulnerability primarily impacts network infrastructure devices running Linux-based kernels, such as routers and switches that utilize PHY LED triggers. The memory leak can lead to gradual exhaustion of system memory during network restarts or PHY device reinitializations, potentially causing device instability, degraded network performance, or even outages due to out-of-memory conditions. This can disrupt critical network services, affecting business continuity, especially in sectors reliant on stable and high-availability networking such as telecommunications, finance, healthcare, and government. While the vulnerability does not directly allow code execution or privilege escalation, the resulting denial of service through resource exhaustion can be leveraged in targeted attacks or combined with other vulnerabilities. The lack of requirement for user interaction or authentication to trigger the leak (assuming network restart or PHY reinitialization events can be induced remotely or locally) increases the risk profile. However, the impact is somewhat limited to devices with affected kernel versions and specific PHY LED trigger usage, which may reduce the attack surface in some environments.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernel versions to those containing the patch that replaces devm_kzalloc/devm_kcalloc with standard kzalloc/kcalloc and adds corresponding kfree calls in the unregister path. Network device vendors should be contacted to confirm firmware or kernel updates addressing this issue. For environments where immediate patching is not feasible, monitoring memory usage on network devices during network restarts or PHY reinitializations can help detect abnormal memory consumption indicative of the leak. Network administrators should also review device configurations to minimize unnecessary PHY device reinitializations and consider implementing automated device restarts or memory cleanup scripts as temporary mitigations. Additionally, organizations should maintain robust network segmentation and access controls to limit exposure of vulnerable devices to untrusted networks, reducing the risk of remote exploitation. Finally, integrating this vulnerability into vulnerability management and patching workflows will ensure timely remediation as updates become available.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-04-16T04:51:23.976Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682cd0f71484d88663aeadfd

Added to database: 5/20/2025, 6:59:03 PM

Last enriched: 7/3/2025, 7:26:22 PM

Last updated: 7/30/2025, 4:08:33 PM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats