CVE-2025-37945: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: net: phy: allow MDIO bus PM ops to start/stop state machine for phylink-controlled PHY DSA has 2 kinds of drivers: 1. Those who call dsa_switch_suspend() and dsa_switch_resume() from their device PM ops: qca8k-8xxx, bcm_sf2, microchip ksz 2. Those who don't: all others. The above methods should be optional. For type 1, dsa_switch_suspend() calls dsa_user_suspend() -> phylink_stop(), and dsa_switch_resume() calls dsa_user_resume() -> phylink_start(). These seem good candidates for setting mac_managed_pm = true because that is essentially its definition [1], but that does not seem to be the biggest problem for now, and is not what this change focuses on. Talking strictly about the 2nd category of DSA drivers here (which do not have MAC managed PM, meaning that for their attached PHYs, mdio_bus_phy_suspend() and mdio_bus_phy_resume() should run in full), I have noticed that the following warning from mdio_bus_phy_resume() is triggered: WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY && phydev->state != PHY_UP); because the PHY state machine is running. It's running as a result of a previous dsa_user_open() -> ... -> phylink_start() -> phy_start() having been initiated by the user. The previous mdio_bus_phy_suspend() was supposed to have called phy_stop_machine(), but it didn't. So this is why the PHY is in state PHY_NOLINK by the time mdio_bus_phy_resume() runs. mdio_bus_phy_suspend() did not call phy_stop_machine() because for phylink, the phydev->adjust_link function pointer is NULL. This seems a technicality introduced by commit fddd91016d16 ("phylib: fix PAL state machine restart on resume"). That commit was written before phylink existed, and was intended to avoid crashing with consumer drivers which don't use the PHY state machine - phylink always does, when using a PHY. But phylink itself has historically not been developed with suspend/resume in mind, and apparently not tested too much in that scenario, allowing this bug to exist unnoticed for so long. Plus, prior to the WARN_ON(), it would have likely been invisible. This issue is not in fact restricted to type 2 DSA drivers (according to the above ad-hoc classification), but can be extrapolated to any MAC driver with phylink and MDIO-bus-managed PHY PM ops. DSA is just where the issue was reported. Assuming mac_managed_pm is set correctly, a quick search indicates the following other drivers might be affected: $ grep -Zlr PHYLINK_NETDEV drivers/ | xargs -0 grep -L mac_managed_pm drivers/net/ethernet/atheros/ag71xx.c drivers/net/ethernet/microchip/sparx5/sparx5_main.c drivers/net/ethernet/microchip/lan966x/lan966x_main.c drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c drivers/net/ethernet/freescale/dpaa/dpaa_eth.c drivers/net/ethernet/freescale/ucc_geth.c drivers/net/ethernet/freescale/enetc/enetc_pf_common.c drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c drivers/net/ethernet/marvell/mvneta.c drivers/net/ethernet/marvell/prestera/prestera_main.c drivers/net/ethernet/mediatek/mtk_eth_soc.c drivers/net/ethernet/altera/altera_tse_main.c drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c drivers/net/ethernet/meta/fbnic/fbnic_phylink.c drivers/net/ethernet/tehuti/tn40_phy.c drivers/net/ethernet/mscc/ocelot_net.c Make the existing conditions dependent on the PHY device having a phydev->phy_link_change() implementation equal to the default phy_link_change() provided by phylib. Otherwise, we implicitly know that the phydev has the phylink-provided phylink_phy_change() callback, and when phylink is used, the PHY state machine always needs to be stopped/ started on the suspend/resume path. The code is structured as such that if phydev->phy_link_change() is absent, it is a matter of time until the kernel will crash - no need to further complicate the test. Thus, for the situation where the PM is not managed b ---truncated---
AI Analysis
Technical Summary
CVE-2025-37945 is a vulnerability identified in the Linux kernel's handling of PHY (physical layer) devices managed via the MDIO (Management Data Input/Output) bus, specifically impacting the suspend/resume power management operations for phylink-controlled PHYs. The issue arises due to improper management of the PHY state machine during system suspend and resume cycles. Linux kernel's Distributed Switch Architecture (DSA) drivers are categorized into two types: those that invoke dsa_switch_suspend() and dsa_switch_resume() in their device power management (PM) operations, and those that do not. The vulnerability primarily affects the second category, where the PHY state machine is not properly stopped during suspend, leading to a WARN_ON() condition triggered in mdio_bus_phy_resume() because the PHY device state is inconsistent (neither PHY_HALTED, PHY_READY, nor PHY_UP). This inconsistency stems from the failure of mdio_bus_phy_suspend() to call phy_stop_machine(), which is necessary to halt the PHY state machine before suspend. The root cause is linked to the phylink subsystem not setting the adjust_link function pointer, a technicality introduced by a prior commit intended to avoid crashes in non-phylink drivers but inadvertently causing issues for phylink-managed PHYs. This flaw has remained unnoticed due to limited testing of phylink suspend/resume paths. Beyond DSA drivers, other MAC drivers using phylink and MDIO-bus-managed PHY PM ops without proper mac_managed_pm settings are potentially affected, including drivers from vendors like Atheros, Microchip, Freescale, Marvell, Mediatek, and others. The vulnerability could lead to kernel warnings and potentially system instability or crashes during suspend/resume cycles, especially in network drivers relying on phylink. The patch involves making the suspend/resume operations conditional on the presence of the default phy_link_change() callback, ensuring the PHY state machine is correctly stopped and restarted, preventing the inconsistent PHY state and associated warnings or crashes.
Potential Impact
For European organizations, this vulnerability poses risks primarily to systems running Linux kernels with affected network drivers, especially in environments where suspend/resume cycles are frequent, such as laptops, embedded devices, and network appliances. The impact includes potential system instability, kernel warnings, or crashes during power management operations, which could disrupt network connectivity and availability. Critical infrastructure relying on Linux-based network equipment, including telecommunications, industrial control systems, and data centers, may experience degraded performance or outages. Since many European enterprises and service providers deploy Linux-based networking hardware from vendors like Microchip, Marvell, and Freescale, the vulnerability could affect a broad range of devices. Although no known exploits are reported in the wild, the flaw's presence in core kernel networking components means that unpatched systems could face reliability issues, complicating maintenance and potentially leading to denial of service conditions. Additionally, the complexity of the issue and its subtle manifestation may delay detection and remediation, increasing exposure time.
Mitigation Recommendations
European organizations should prioritize updating Linux kernels to versions where this vulnerability is patched, ensuring that all network drivers using phylink and MDIO-bus-managed PHY PM operations have the correct mac_managed_pm settings. Specifically, system administrators and device manufacturers should: 1) Audit their Linux kernel versions and network driver configurations to identify affected drivers listed in the vulnerability description (e.g., qca8k-8xxx, bcm_sf2, microchip ksz, and others mentioned). 2) Apply kernel patches or upgrade to kernel releases that include the fix for CVE-2025-37945, which correctly manage the PHY state machine during suspend/resume cycles. 3) Test suspend/resume functionality extensively in controlled environments to detect any residual issues related to PHY state management. 4) For embedded and network appliance vendors, incorporate the fix into firmware updates and communicate with customers about the importance of applying these updates. 5) Monitor kernel logs for WARN_ON() messages related to PHY state inconsistencies as an early indicator of the vulnerability's manifestation. 6) Where immediate patching is not feasible, consider disabling suspend/resume features on affected devices as a temporary workaround, understanding the trade-offs in power management capabilities.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Italy, Spain, Poland, Belgium
CVE-2025-37945: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: net: phy: allow MDIO bus PM ops to start/stop state machine for phylink-controlled PHY DSA has 2 kinds of drivers: 1. Those who call dsa_switch_suspend() and dsa_switch_resume() from their device PM ops: qca8k-8xxx, bcm_sf2, microchip ksz 2. Those who don't: all others. The above methods should be optional. For type 1, dsa_switch_suspend() calls dsa_user_suspend() -> phylink_stop(), and dsa_switch_resume() calls dsa_user_resume() -> phylink_start(). These seem good candidates for setting mac_managed_pm = true because that is essentially its definition [1], but that does not seem to be the biggest problem for now, and is not what this change focuses on. Talking strictly about the 2nd category of DSA drivers here (which do not have MAC managed PM, meaning that for their attached PHYs, mdio_bus_phy_suspend() and mdio_bus_phy_resume() should run in full), I have noticed that the following warning from mdio_bus_phy_resume() is triggered: WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY && phydev->state != PHY_UP); because the PHY state machine is running. It's running as a result of a previous dsa_user_open() -> ... -> phylink_start() -> phy_start() having been initiated by the user. The previous mdio_bus_phy_suspend() was supposed to have called phy_stop_machine(), but it didn't. So this is why the PHY is in state PHY_NOLINK by the time mdio_bus_phy_resume() runs. mdio_bus_phy_suspend() did not call phy_stop_machine() because for phylink, the phydev->adjust_link function pointer is NULL. This seems a technicality introduced by commit fddd91016d16 ("phylib: fix PAL state machine restart on resume"). That commit was written before phylink existed, and was intended to avoid crashing with consumer drivers which don't use the PHY state machine - phylink always does, when using a PHY. But phylink itself has historically not been developed with suspend/resume in mind, and apparently not tested too much in that scenario, allowing this bug to exist unnoticed for so long. Plus, prior to the WARN_ON(), it would have likely been invisible. This issue is not in fact restricted to type 2 DSA drivers (according to the above ad-hoc classification), but can be extrapolated to any MAC driver with phylink and MDIO-bus-managed PHY PM ops. DSA is just where the issue was reported. Assuming mac_managed_pm is set correctly, a quick search indicates the following other drivers might be affected: $ grep -Zlr PHYLINK_NETDEV drivers/ | xargs -0 grep -L mac_managed_pm drivers/net/ethernet/atheros/ag71xx.c drivers/net/ethernet/microchip/sparx5/sparx5_main.c drivers/net/ethernet/microchip/lan966x/lan966x_main.c drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c drivers/net/ethernet/freescale/dpaa/dpaa_eth.c drivers/net/ethernet/freescale/ucc_geth.c drivers/net/ethernet/freescale/enetc/enetc_pf_common.c drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c drivers/net/ethernet/marvell/mvneta.c drivers/net/ethernet/marvell/prestera/prestera_main.c drivers/net/ethernet/mediatek/mtk_eth_soc.c drivers/net/ethernet/altera/altera_tse_main.c drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c drivers/net/ethernet/meta/fbnic/fbnic_phylink.c drivers/net/ethernet/tehuti/tn40_phy.c drivers/net/ethernet/mscc/ocelot_net.c Make the existing conditions dependent on the PHY device having a phydev->phy_link_change() implementation equal to the default phy_link_change() provided by phylib. Otherwise, we implicitly know that the phydev has the phylink-provided phylink_phy_change() callback, and when phylink is used, the PHY state machine always needs to be stopped/ started on the suspend/resume path. The code is structured as such that if phydev->phy_link_change() is absent, it is a matter of time until the kernel will crash - no need to further complicate the test. Thus, for the situation where the PM is not managed b ---truncated---
AI-Powered Analysis
Technical Analysis
CVE-2025-37945 is a vulnerability identified in the Linux kernel's handling of PHY (physical layer) devices managed via the MDIO (Management Data Input/Output) bus, specifically impacting the suspend/resume power management operations for phylink-controlled PHYs. The issue arises due to improper management of the PHY state machine during system suspend and resume cycles. Linux kernel's Distributed Switch Architecture (DSA) drivers are categorized into two types: those that invoke dsa_switch_suspend() and dsa_switch_resume() in their device power management (PM) operations, and those that do not. The vulnerability primarily affects the second category, where the PHY state machine is not properly stopped during suspend, leading to a WARN_ON() condition triggered in mdio_bus_phy_resume() because the PHY device state is inconsistent (neither PHY_HALTED, PHY_READY, nor PHY_UP). This inconsistency stems from the failure of mdio_bus_phy_suspend() to call phy_stop_machine(), which is necessary to halt the PHY state machine before suspend. The root cause is linked to the phylink subsystem not setting the adjust_link function pointer, a technicality introduced by a prior commit intended to avoid crashes in non-phylink drivers but inadvertently causing issues for phylink-managed PHYs. This flaw has remained unnoticed due to limited testing of phylink suspend/resume paths. Beyond DSA drivers, other MAC drivers using phylink and MDIO-bus-managed PHY PM ops without proper mac_managed_pm settings are potentially affected, including drivers from vendors like Atheros, Microchip, Freescale, Marvell, Mediatek, and others. The vulnerability could lead to kernel warnings and potentially system instability or crashes during suspend/resume cycles, especially in network drivers relying on phylink. The patch involves making the suspend/resume operations conditional on the presence of the default phy_link_change() callback, ensuring the PHY state machine is correctly stopped and restarted, preventing the inconsistent PHY state and associated warnings or crashes.
Potential Impact
For European organizations, this vulnerability poses risks primarily to systems running Linux kernels with affected network drivers, especially in environments where suspend/resume cycles are frequent, such as laptops, embedded devices, and network appliances. The impact includes potential system instability, kernel warnings, or crashes during power management operations, which could disrupt network connectivity and availability. Critical infrastructure relying on Linux-based network equipment, including telecommunications, industrial control systems, and data centers, may experience degraded performance or outages. Since many European enterprises and service providers deploy Linux-based networking hardware from vendors like Microchip, Marvell, and Freescale, the vulnerability could affect a broad range of devices. Although no known exploits are reported in the wild, the flaw's presence in core kernel networking components means that unpatched systems could face reliability issues, complicating maintenance and potentially leading to denial of service conditions. Additionally, the complexity of the issue and its subtle manifestation may delay detection and remediation, increasing exposure time.
Mitigation Recommendations
European organizations should prioritize updating Linux kernels to versions where this vulnerability is patched, ensuring that all network drivers using phylink and MDIO-bus-managed PHY PM operations have the correct mac_managed_pm settings. Specifically, system administrators and device manufacturers should: 1) Audit their Linux kernel versions and network driver configurations to identify affected drivers listed in the vulnerability description (e.g., qca8k-8xxx, bcm_sf2, microchip ksz, and others mentioned). 2) Apply kernel patches or upgrade to kernel releases that include the fix for CVE-2025-37945, which correctly manage the PHY state machine during suspend/resume cycles. 3) Test suspend/resume functionality extensively in controlled environments to detect any residual issues related to PHY state management. 4) For embedded and network appliance vendors, incorporate the fix into firmware updates and communicate with customers about the importance of applying these updates. 5) Monitor kernel logs for WARN_ON() messages related to PHY state inconsistencies as an early indicator of the vulnerability's manifestation. 6) Where immediate patching is not feasible, consider disabling suspend/resume features on affected devices as a temporary workaround, understanding the trade-offs in power management capabilities.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2025-04-16T04:51:23.972Z
- Cisa Enriched
- false
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682cd0f71484d88663aeaedc
Added to database: 5/20/2025, 6:59:03 PM
Last enriched: 7/4/2025, 2:10:50 AM
Last updated: 8/15/2025, 12:42:59 AM
Views: 13
Related Threats
CVE-2025-53948: CWE-415 Double Free in Santesoft Sante PACS Server
HighCVE-2025-52584: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-46269: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-54862: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumCVE-2025-54759: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.