UBUNTU-CVE-2025-37945
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---
02 / AFFECTED SOFTWARE
Affected packages
50 explicit affected versions
6 explicit affected versions
26 explicit affected versions
3 explicit affected versions
8 explicit affected versions
10 explicit affected versions
7 explicit affected versions
37 explicit affected versions
13 explicit affected versions
79 explicit affected versions
13 explicit affected versions
1 explicit affected versions
1 explicit affected versions
1 explicit affected versions
91 explicit affected versions
80 explicit affected versions
11 explicit affected versions
89 explicit affected versions
12 explicit affected versions
19 explicit affected versions
6 explicit affected versions
100 explicit affected versions
24 explicit affected versions
28 explicit affected versions
85 explicit affected versions
84 explicit affected versions
86 explicit affected versions
76 explicit affected versions
10 explicit affected versions
26 explicit affected versions
90 explicit affected versions
7 explicit affected versions
84 explicit affected versions
32 explicit affected versions
13 explicit affected versions
35 explicit affected versions
35 explicit affected versions
51 explicit affected versions
50 explicit affected versions
18 explicit affected versions
42 explicit affected versions
64 explicit affected versions
37 explicit affected versions
13 explicit affected versions
4 explicit affected versions
10 explicit affected versions
23 explicit affected versions
43 explicit affected versions
1 explicit affected versions
21 explicit affected versions
9 explicit affected versions
16 explicit affected versions
39 explicit affected versions
8 explicit affected versions
7 explicit affected versions
12 explicit affected versions
7 explicit affected versions
69 explicit affected versions
12 explicit affected versions
14 explicit affected versions
10 explicit affected versions
1 explicit affected versions
7 explicit affected versions
9 explicit affected versions
12 explicit affected versions
12 explicit affected versions
32 explicit affected versions
45 explicit affected versions
23 explicit affected versions
25 explicit affected versions
10 explicit affected versions
37 explicit affected versions
10 explicit affected versions
13 explicit affected versions
31 explicit affected versions
10 explicit affected versions
68 explicit affected versions
26 explicit affected versions
3 explicit affected versions
13 explicit affected versions
37 explicit affected versions
29 explicit affected versions
13 explicit affected versions
96 explicit affected versions
32 explicit affected versions
32 explicit affected versions
92 explicit affected versions
55 explicit affected versions
33 explicit affected versions
23 explicit affected versions
60 explicit affected versions
10 explicit affected versions
11 explicit affected versions
10 explicit affected versions
11 explicit affected versions
12 explicit affected versions
7 explicit affected versions
12 explicit affected versions
77 explicit affected versions
93 explicit affected versions
10 explicit affected versions
26 explicit affected versions
31 explicit affected versions
1 explicit affected versions
38 explicit affected versions
13 explicit affected versions
37 explicit affected versions
16 explicit affected versions
91 explicit affected versions
41 explicit affected versions
3 explicit affected versions
7 explicit affected versions
2 explicit affected versions
51 explicit affected versions
18 explicit affected versions
33 explicit affected versions
12 explicit affected versions
71 explicit affected versions
80 explicit affected versions
27 explicit affected versions
66 explicit affected versions
34 explicit affected versions
8 explicit affected versions
55 explicit affected versions
5 explicit affected versions
13 explicit affected versions
7 explicit affected versions
8 explicit affected versions
10 explicit affected versions
12 explicit affected versions
26 explicit affected versions
39 explicit affected versions
44 explicit affected versions
16 explicit affected versions
3 explicit affected versions
13 explicit affected versions
45 explicit affected versions
37 explicit affected versions
42 explicit affected versions
14 explicit affected versions
38 explicit affected versions
9 explicit affected versions
11 explicit affected versions
30 explicit affected versions
13 explicit affected versions
92 explicit affected versions
8 explicit affected versions
7 explicit affected versions
4 explicit affected versions
81 explicit affected versions
43 explicit affected versions
10 explicit affected versions
8 explicit affected versions
36 explicit affected versions
14 explicit affected versions
4 explicit affected versions
78 explicit affected versions
11 explicit affected versions
1 explicit affected versions
10 explicit affected versions
30 explicit affected versions
80 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
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---
05 / REFERENCES
Further evidence
- https://git.kernel.org/linus/fc75ea20ffb452652f0d4033f38fe88d7cfdae35
- https://git.kernel.org/stable/c/54e5d00a8de6c13f6c01a94ed48025e882cd15f7
- https://git.kernel.org/stable/c/a6ed6f8ec81b8ca7100dcd9e62bdbc0dff1b2259
- https://git.kernel.org/stable/c/bd4037d51d3f6667636a1383e78e48a5b7b60755
- https://git.kernel.org/stable/c/fc75ea20ffb452652f0d4033f38fe88d7cfdae35
- https://ubuntu.com/security/CVE-2025-37945
- https://ubuntu.com/security/notices/USN-7594-1
- https://ubuntu.com/security/notices/USN-7594-2
- https://ubuntu.com/security/notices/USN-7594-3
- https://ubuntu.com/security/notices/USN-8028-1
- https://ubuntu.com/security/notices/USN-8028-2
- https://ubuntu.com/security/notices/USN-8028-3
- https://ubuntu.com/security/notices/USN-8028-4
- https://ubuntu.com/security/notices/USN-8028-5
- https://ubuntu.com/security/notices/USN-8028-6
- https://ubuntu.com/security/notices/USN-8028-7
- https://ubuntu.com/security/notices/USN-8028-8
- https://ubuntu.com/security/notices/USN-8031-1
- https://ubuntu.com/security/notices/USN-8031-2
- https://ubuntu.com/security/notices/USN-8031-3
- https://ubuntu.com/security/notices/USN-8052-1
- https://ubuntu.com/security/notices/USN-8052-2
- https://ubuntu.com/security/notices/USN-8074-1
- https://ubuntu.com/security/notices/USN-8074-2
- https://ubuntu.com/security/notices/USN-8126-1
- https://www.cve.org/CVERecord?id=CVE-2025-37945