CVE Vulnerabilities

CVE-2025-39915

Improper Locking

Published: Oct 01, 2025 | Modified: Jan 14, 2026
CVSS 3.x
5.5
MEDIUM
Source:
NVD
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
4.7 MODERATE
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:H
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

In the Linux kernel, the following vulnerability has been resolved:

net: phy: transfer phy_config_inband() locking responsibility to phylink

Problem description

Lockdep reports a possible circular locking dependency (AB/BA) between &pl->state_mutex and &phy->lock, as follows.

phylink_resolve() // acquires &pl->state_mutex -> phylink_major_config() -> phy_config_inband() // acquires &pl->phydev->lock

whereas all the other call sites where &pl->state_mutex and &pl->phydev->lock have the locking scheme reversed. Everywhere else, &pl->phydev->lock is acquired at the top level, and &pl->state_mutex at the lower level. A clear example is phylink_bringup_phy().

The outlier is the newly introduced phy_config_inband() and the existing lock order is the correct one. To understand why it cannot be the other way around, it is sufficient to consider phylink_phy_change(), phylinks callback from the PHY devices phy->phy_link_change() virtual method, invoked by the PHY state machine.

phy_link_up() and phy_link_down(), the (indirect) callers of phylink_phy_change(), are called with &phydev->lock acquired. Then phylink_phy_change() acquires its own &pl->state_mutex, to serialize changes made to its pl->phy_state and pl->link_config. So all other instances of &pl->state_mutex and &phydev->lock must be consistent with this order.

Problem impact

I think the kernel runs a serious deadlock risk if an existing phylink_resolve() thread, which results in a phy_config_inband() call, is concurrent with a phy_link_up() or phy_link_down() call, which will deadlock on &pl->state_mutex in phylink_phy_change(). Practically speaking, the impact may be limited by the slow speed of the medium auto-negotiation protocol, which makes it unlikely for the current state to still be unresolved when a new one is detected, but I think the problem is there. Nonetheless, the problem was discovered using lockdep.

Proposed solution

Practically speaking, the phy_config_inband() requirement of having phydev->lock acquired must transfer to the caller (phylink is the only caller). There, it must bubble up until immediately before &pl->state_mutex is acquired, for the cases where that takes place.

Solution details, considerations, notes

This is the phy_config_inband() call graph:

                      sfp_upstream_ops :: connect_phy()
                      |
                      v
                      phylink_sfp_connect_phy()
                      |
                      v
                      phylink_sfp_config_phy()
                      |
                      |   sfp_upstream_ops :: module_insert()
                      |   |
                      |   v
                      |   phylink_sfp_module_insert()
                      |   |
                      |   |   sfp_upstream_ops :: module_start()
                      |   |   |
                      |   |   v
                      |   |   phylink_sfp_module_start()
                      |   |   |
                      |   v   v
                      |   phylink_sfp_config_optical()

phylink_start() | | | phylink_resume() v v | | phylink_sfp_set_config() | | | v v v phylink_mac_initial_config() | phylink_resolve() | | phylink_ethtool_ksettings_set() v v v phylink_major_config() | v phy_config_inband()

phylink_major_config() caller #1, phylink_mac_initial_config(), does not acquire &pl->state_mutex nor do its callers. It must acquire &pl->phydev->lock prior to calling phylink_major_config().

phylink_major_config() caller #2, phylink_resolve() acquires &pl->state_mutex, thus also needs to acquire &pl->phydev->lock.

phylink_major_config() caller #3, phylink_ethtool_ksettings_set(), is completely uninteresting, because it only call —truncated—

Weakness

The product does not properly acquire or release a lock on a resource, leading to unexpected resource state changes and behaviors.

Affected Software

NameVendorStart VersionEnd Version
Linux_kernelLinux6.14 (including)6.16.8 (excluding)
Linux_kernelLinux6.17-rc1 (including)6.17-rc1 (including)
Linux_kernelLinux6.17-rc2 (including)6.17-rc2 (including)
Linux_kernelLinux6.17-rc3 (including)6.17-rc3 (including)
Linux_kernelLinux6.17-rc4 (including)6.17-rc4 (including)
Linux_kernelLinux6.17-rc5 (including)6.17-rc5 (including)
LinuxUbuntuplucky*
LinuxUbuntuupstream*
Linux-allwinner-5.19Ubuntujammy*
Linux-allwinner-5.19Ubuntuupstream*
Linux-awsUbuntuplucky*
Linux-awsUbuntuupstream*
Linux-aws-5.0Ubuntubionic*
Linux-aws-5.0Ubuntuesm-infra/bionic*
Linux-aws-5.0Ubuntuupstream*
Linux-aws-5.11Ubuntuesm-infra/focal*
Linux-aws-5.11Ubuntufocal*
Linux-aws-5.11Ubuntuupstream*
Linux-aws-5.13Ubuntuesm-infra/focal*
Linux-aws-5.13Ubuntufocal*
Linux-aws-5.13Ubuntuupstream*
Linux-aws-5.15Ubuntuupstream*
Linux-aws-5.19Ubuntujammy*
Linux-aws-5.19Ubuntuupstream*
Linux-aws-5.3Ubuntubionic*
Linux-aws-5.3Ubuntuesm-infra/bionic*
Linux-aws-5.3Ubuntuupstream*
Linux-aws-5.4Ubuntuupstream*
Linux-aws-5.8Ubuntuesm-infra/focal*
Linux-aws-5.8Ubuntufocal*
Linux-aws-5.8Ubuntuupstream*
Linux-aws-6.14Ubuntunoble*
Linux-aws-6.14Ubuntuupstream*
Linux-aws-6.2Ubuntujammy*
Linux-aws-6.2Ubuntuupstream*
Linux-aws-6.5Ubuntujammy*
Linux-aws-6.5Ubuntuupstream*
Linux-aws-6.8Ubuntuupstream*
Linux-aws-fipsUbuntutrusty*
Linux-aws-fipsUbuntuupstream*
Linux-aws-fipsUbuntuxenial*
Linux-aws-hweUbuntuupstream*
Linux-azureUbuntubionic*
Linux-azureUbuntuesm-infra/bionic*
Linux-azureUbuntuplucky*
Linux-azureUbuntuupstream*
Linux-azure-4.15Ubuntuupstream*
Linux-azure-5.11Ubuntuesm-infra/focal*
Linux-azure-5.11Ubuntufocal*
Linux-azure-5.11Ubuntuupstream*
Linux-azure-5.13Ubuntuesm-infra/focal*
Linux-azure-5.13Ubuntufocal*
Linux-azure-5.13Ubuntuupstream*
Linux-azure-5.15Ubuntuupstream*
Linux-azure-5.19Ubuntujammy*
Linux-azure-5.19Ubuntuupstream*
Linux-azure-5.3Ubuntubionic*
Linux-azure-5.3Ubuntuesm-infra/bionic*
Linux-azure-5.3Ubuntuupstream*
Linux-azure-5.4Ubuntuupstream*
Linux-azure-5.8Ubuntuesm-infra/focal*
Linux-azure-5.8Ubuntufocal*
Linux-azure-5.8Ubuntuupstream*
Linux-azure-6.11Ubuntunoble*
Linux-azure-6.11Ubuntuupstream*
Linux-azure-6.14Ubuntunoble*
Linux-azure-6.14Ubuntuupstream*
Linux-azure-6.2Ubuntujammy*
Linux-azure-6.2Ubuntuupstream*
Linux-azure-6.5Ubuntujammy*
Linux-azure-6.5Ubuntuupstream*
Linux-azure-6.8Ubuntuupstream*
Linux-azure-edgeUbuntubionic*
Linux-azure-edgeUbuntuesm-infra/bionic*
Linux-azure-edgeUbuntuupstream*
Linux-azure-fdeUbuntuesm-infra/focal*
Linux-azure-fdeUbuntufocal*
Linux-azure-fdeUbuntuplucky*
Linux-azure-fdeUbuntuupstream*
Linux-azure-fde-5.15Ubuntuupstream*
Linux-azure-fde-5.19Ubuntujammy*
Linux-azure-fde-5.19Ubuntuupstream*
Linux-azure-fde-6.14Ubuntunoble*
Linux-azure-fde-6.14Ubuntuupstream*
Linux-azure-fde-6.2Ubuntujammy*
Linux-azure-fde-6.2Ubuntuupstream*
Linux-azure-fde-6.8Ubuntuupstream*
Linux-azure-fipsUbuntutrusty*
Linux-azure-fipsUbuntuupstream*
Linux-azure-fipsUbuntuxenial*
Linux-azure-nvidiaUbuntuupstream*
Linux-azure-nvidia-6.14Ubuntunoble*
Linux-azure-nvidia-6.14Ubuntuupstream*
Linux-bluefieldUbuntuupstream*
Linux-fipsUbuntuupstream*
Linux-gcpUbuntubionic*
Linux-gcpUbuntuesm-infra/bionic*
Linux-gcpUbuntuplucky*
Linux-gcpUbuntuupstream*
Linux-gcp-4.15Ubuntuupstream*
Linux-gcp-5.11Ubuntuesm-infra/focal*
Linux-gcp-5.11Ubuntufocal*
Linux-gcp-5.11Ubuntuupstream*
Linux-gcp-5.13Ubuntuesm-infra/focal*
Linux-gcp-5.13Ubuntufocal*
Linux-gcp-5.13Ubuntuupstream*
Linux-gcp-5.15Ubuntuupstream*
Linux-gcp-5.19Ubuntujammy*
Linux-gcp-5.19Ubuntuupstream*
Linux-gcp-5.3Ubuntubionic*
Linux-gcp-5.3Ubuntuesm-infra/bionic*
Linux-gcp-5.3Ubuntuupstream*
Linux-gcp-5.4Ubuntuupstream*
Linux-gcp-5.8Ubuntuesm-infra/focal*
Linux-gcp-5.8Ubuntufocal*
Linux-gcp-5.8Ubuntuupstream*
Linux-gcp-6.11Ubuntunoble*
Linux-gcp-6.11Ubuntuupstream*
Linux-gcp-6.14Ubuntunoble*
Linux-gcp-6.14Ubuntuupstream*
Linux-gcp-6.2Ubuntujammy*
Linux-gcp-6.2Ubuntuupstream*
Linux-gcp-6.5Ubuntujammy*
Linux-gcp-6.5Ubuntuupstream*
Linux-gcp-6.8Ubuntuupstream*
Linux-gcp-fipsUbuntutrusty*
Linux-gcp-fipsUbuntuupstream*
Linux-gcp-fipsUbuntuxenial*
Linux-gkeUbuntuesm-infra/focal*
Linux-gkeUbuntufocal*
Linux-gkeUbuntuupstream*
Linux-gkeUbuntuxenial*
Linux-gke-4.15Ubuntubionic*
Linux-gke-4.15Ubuntuesm-infra/bionic*
Linux-gke-4.15Ubuntuupstream*
Linux-gke-5.15Ubuntuesm-infra/focal*
Linux-gke-5.15Ubuntufocal*
Linux-gke-5.15Ubuntuupstream*
Linux-gke-5.4Ubuntubionic*
Linux-gke-5.4Ubuntuesm-infra/bionic*
Linux-gke-5.4Ubuntuupstream*
Linux-gkeopUbuntuesm-infra/focal*
Linux-gkeopUbuntufocal*
Linux-gkeopUbuntuupstream*
Linux-gkeop-5.15Ubuntuesm-infra/focal*
Linux-gkeop-5.15Ubuntufocal*
Linux-gkeop-5.15Ubuntuupstream*
Linux-gkeop-5.4Ubuntubionic*
Linux-gkeop-5.4Ubuntuesm-infra/bionic*
Linux-gkeop-5.4Ubuntuupstream*
Linux-hweUbuntubionic*
Linux-hweUbuntuesm-infra/bionic*
Linux-hweUbuntuupstream*
Linux-hwe-5.11Ubuntuesm-infra/focal*
Linux-hwe-5.11Ubuntufocal*
Linux-hwe-5.11Ubuntuupstream*
Linux-hwe-5.13Ubuntuesm-infra/focal*
Linux-hwe-5.13Ubuntufocal*
Linux-hwe-5.13Ubuntuupstream*
Linux-hwe-5.15Ubuntuupstream*
Linux-hwe-5.19Ubuntujammy*
Linux-hwe-5.19Ubuntuupstream*
Linux-hwe-5.4Ubuntuupstream*
Linux-hwe-5.8Ubuntuesm-infra/focal*
Linux-hwe-5.8Ubuntufocal*
Linux-hwe-5.8Ubuntuupstream*
Linux-hwe-6.11Ubuntunoble*
Linux-hwe-6.11Ubuntuupstream*
Linux-hwe-6.14Ubuntunoble*
Linux-hwe-6.14Ubuntuupstream*
Linux-hwe-6.2Ubuntujammy*
Linux-hwe-6.2Ubuntuupstream*
Linux-hwe-6.5Ubuntujammy*
Linux-hwe-6.5Ubuntuupstream*
Linux-hwe-6.8Ubuntuupstream*
Linux-hwe-edgeUbuntubionic*
Linux-hwe-edgeUbuntuesm-infra/bionic*
Linux-hwe-edgeUbuntuesm-infra/xenial*
Linux-hwe-edgeUbuntuupstream*
Linux-hwe-edgeUbuntuxenial*
Linux-ibmUbuntuupstream*
Linux-ibm-5.15Ubuntuupstream*
Linux-ibm-5.4Ubuntuupstream*
Linux-ibm-6.8Ubuntuupstream*
Linux-intelUbuntunoble*
Linux-intelUbuntuupstream*
Linux-intel-5.13Ubuntuesm-infra/focal*
Linux-intel-5.13Ubuntufocal*
Linux-intel-5.13Ubuntuupstream*
Linux-intel-iot-realtimeUbuntujammy*
Linux-intel-iot-realtimeUbuntuupstream*
Linux-intel-iotgUbuntuupstream*
Linux-intel-iotg-5.15Ubuntuupstream*
Linux-iotUbuntuupstream*
Linux-kvmUbuntuupstream*
Linux-lowlatencyUbuntuupstream*
Linux-lowlatency-hwe-5.15Ubuntuupstream*
Linux-lowlatency-hwe-5.19Ubuntujammy*
Linux-lowlatency-hwe-5.19Ubuntuupstream*
Linux-lowlatency-hwe-6.11Ubuntunoble*
Linux-lowlatency-hwe-6.11Ubuntuupstream*
Linux-lowlatency-hwe-6.2Ubuntujammy*
Linux-lowlatency-hwe-6.2Ubuntuupstream*
Linux-lowlatency-hwe-6.5Ubuntujammy*
Linux-lowlatency-hwe-6.5Ubuntuupstream*
Linux-lowlatency-hwe-6.8Ubuntuupstream*
Linux-lts-xenialUbuntuupstream*
Linux-nvidiaUbuntuupstream*
Linux-nvidia-6.11Ubuntuupstream*
Linux-nvidia-6.2Ubuntujammy*
Linux-nvidia-6.2Ubuntuupstream*
Linux-nvidia-6.5Ubuntujammy*
Linux-nvidia-6.5Ubuntuupstream*
Linux-nvidia-6.8Ubuntuupstream*
Linux-nvidia-lowlatencyUbuntuupstream*
Linux-nvidia-tegraUbuntuupstream*
Linux-nvidia-tegra-5.15Ubuntuupstream*
Linux-nvidia-tegra-igxUbuntuupstream*
Linux-oemUbuntubionic*
Linux-oemUbuntuesm-infra/bionic*
Linux-oemUbuntuupstream*
Linux-oemUbuntuxenial*
Linux-oem-5.10Ubuntuesm-infra/focal*
Linux-oem-5.10Ubuntufocal*
Linux-oem-5.10Ubuntuupstream*
Linux-oem-5.13Ubuntuesm-infra/focal*
Linux-oem-5.13Ubuntufocal*
Linux-oem-5.13Ubuntuupstream*
Linux-oem-5.14Ubuntuesm-infra/focal*
Linux-oem-5.14Ubuntufocal*
Linux-oem-5.14Ubuntuupstream*
Linux-oem-5.17Ubuntujammy*
Linux-oem-5.17Ubuntuupstream*
Linux-oem-5.6Ubuntuesm-infra/focal*
Linux-oem-5.6Ubuntufocal*
Linux-oem-5.6Ubuntuupstream*
Linux-oem-6.0Ubuntujammy*
Linux-oem-6.0Ubuntuupstream*
Linux-oem-6.1Ubuntujammy*
Linux-oem-6.1Ubuntuupstream*
Linux-oem-6.11Ubuntunoble*
Linux-oem-6.11Ubuntuupstream*
Linux-oem-6.14Ubuntunoble*
Linux-oem-6.14Ubuntuupstream*
Linux-oem-6.17Ubuntuupstream*
Linux-oem-6.5Ubuntujammy*
Linux-oem-6.5Ubuntuupstream*
Linux-oem-6.8Ubuntunoble*
Linux-oem-6.8Ubuntuupstream*
Linux-oracleUbuntuplucky*
Linux-oracleUbuntuupstream*
Linux-oracle-5.0Ubuntubionic*
Linux-oracle-5.0Ubuntuesm-infra/bionic*
Linux-oracle-5.0Ubuntuupstream*
Linux-oracle-5.11Ubuntuesm-infra/focal*
Linux-oracle-5.11Ubuntufocal*
Linux-oracle-5.11Ubuntuupstream*
Linux-oracle-5.13Ubuntuesm-infra/focal*
Linux-oracle-5.13Ubuntufocal*
Linux-oracle-5.13Ubuntuupstream*
Linux-oracle-5.15Ubuntuupstream*
Linux-oracle-5.3Ubuntubionic*
Linux-oracle-5.3Ubuntuesm-infra/bionic*
Linux-oracle-5.3Ubuntuupstream*
Linux-oracle-5.4Ubuntuupstream*
Linux-oracle-5.8Ubuntuesm-infra/focal*
Linux-oracle-5.8Ubuntufocal*
Linux-oracle-5.8Ubuntuupstream*
Linux-oracle-6.14Ubuntunoble*
Linux-oracle-6.14Ubuntuupstream*
Linux-oracle-6.5Ubuntujammy*
Linux-oracle-6.5Ubuntuupstream*
Linux-oracle-6.8Ubuntuupstream*
Linux-raspiUbuntuplucky*
Linux-raspiUbuntuupstream*
Linux-raspi-5.4Ubuntuupstream*
Linux-raspi-realtimeUbuntunoble*
Linux-raspi-realtimeUbuntuupstream*
Linux-raspi2Ubuntubionic*
Linux-raspi2Ubuntuesm-infra/focal*
Linux-raspi2Ubuntufocal*
Linux-raspi2Ubuntuupstream*
Linux-raspi2Ubuntuxenial*
Linux-realtimeUbuntujammy*
Linux-realtimeUbuntunoble*
Linux-realtimeUbuntuplucky*
Linux-realtimeUbuntuupstream*
Linux-realtime-6.14Ubunturealtime/noble*
Linux-realtime-6.14Ubuntuupstream*
Linux-realtime-6.8Ubuntuupstream*
Linux-riscvUbuntuesm-infra/focal*
Linux-riscvUbuntufocal*
Linux-riscvUbuntujammy*
Linux-riscvUbuntunoble*
Linux-riscvUbuntuplucky*
Linux-riscvUbuntuupstream*
Linux-riscv-5.11Ubuntuesm-infra/focal*
Linux-riscv-5.11Ubuntufocal*
Linux-riscv-5.11Ubuntuupstream*
Linux-riscv-5.15Ubuntuupstream*
Linux-riscv-5.19Ubuntujammy*
Linux-riscv-5.19Ubuntuupstream*
Linux-riscv-5.8Ubuntuesm-infra/focal*
Linux-riscv-5.8Ubuntufocal*
Linux-riscv-5.8Ubuntuupstream*
Linux-riscv-6.14Ubuntunoble*
Linux-riscv-6.14Ubuntuupstream*
Linux-riscv-6.5Ubuntujammy*
Linux-riscv-6.5Ubuntuupstream*
Linux-riscv-6.8Ubuntuupstream*
Linux-starfive-5.19Ubuntujammy*
Linux-starfive-5.19Ubuntuupstream*
Linux-starfive-6.2Ubuntujammy*
Linux-starfive-6.2Ubuntuupstream*
Linux-starfive-6.5Ubuntujammy*
Linux-starfive-6.5Ubuntuupstream*
Linux-xilinxUbuntuplucky*
Linux-xilinxUbuntuupstream*
Linux-xilinx-zynqmpUbuntuupstream*

Extended Description

Locking is a type of synchronization behavior that ensures that multiple independently-operating processes or threads do not interfere with each other when accessing the same resource. All processes/threads are expected to follow the same steps for locking. If these steps are not followed precisely - or if no locking is done at all - then another process/thread could modify the shared resource in a way that is not visible or predictable to the original process. This can lead to data or memory corruption, denial of service, etc.

Potential Mitigations

References