CVE-2025-38149
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
03/07/2025
Last modified:
03/07/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
net: phy: clear phydev->devlink when the link is deleted<br />
<br />
There is a potential crash issue when disabling and re-enabling the<br />
network port. When disabling the network port, phy_detach() calls<br />
device_link_del() to remove the device link, but it does not clear<br />
phydev->devlink, so phydev->devlink is not a NULL pointer. Then the<br />
network port is re-enabled, but if phy_attach_direct() fails before<br />
calling device_link_add(), the code jumps to the "error" label and<br />
calls phy_detach(). Since phydev->devlink retains the old value from<br />
the previous attach/detach cycle, device_link_del() uses the old value,<br />
which accesses a NULL pointer and causes a crash. The simplified crash<br />
log is as follows.<br />
<br />
[ 24.702421] Call trace:<br />
[ 24.704856] device_link_put_kref+0x20/0x120<br />
[ 24.709124] device_link_del+0x30/0x48<br />
[ 24.712864] phy_detach+0x24/0x168<br />
[ 24.716261] phy_attach_direct+0x168/0x3a4<br />
[ 24.720352] phylink_fwnode_phy_connect+0xc8/0x14c<br />
[ 24.725140] phylink_of_phy_connect+0x1c/0x34<br />
<br />
Therefore, phydev->devlink needs to be cleared when the device link is<br />
deleted.