mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-09-02 18:06:13 +02:00
![]() There is a potential crash issue when disabling and re-enabling the
network port. When disabling the network port, phy_detach() calls
device_link_del() to remove the device link, but it does not clear
phydev->devlink, so phydev->devlink is not a NULL pointer. Then the
network port is re-enabled, but if phy_attach_direct() fails before
calling device_link_add(), the code jumps to the "error" label and
calls phy_detach(). Since phydev->devlink retains the old value from
the previous attach/detach cycle, device_link_del() uses the old value,
which accesses a NULL pointer and causes a crash. The simplified crash
log is as follows.
[ 24.702421] Call trace:
[ 24.704856] device_link_put_kref+0x20/0x120
[ 24.709124] device_link_del+0x30/0x48
[ 24.712864] phy_detach+0x24/0x168
[ 24.716261] phy_attach_direct+0x168/0x3a4
[ 24.720352] phylink_fwnode_phy_connect+0xc8/0x14c
[ 24.725140] phylink_of_phy_connect+0x1c/0x34
Therefore, phydev->devlink needs to be cleared when the device link is
deleted.
Fixes:
|
||
---|---|---|
.. | ||
mscc | ||
adin.c | ||
adin1100.c | ||
amd.c | ||
aquantia_hwmon.c | ||
aquantia_main.c | ||
aquantia.h | ||
at803x.c | ||
ax88796b.c | ||
bcm-cygnus.c | ||
bcm-phy-lib.c | ||
bcm-phy-lib.h | ||
bcm-phy-ptp.c | ||
bcm7xxx.c | ||
bcm63xx.c | ||
bcm87xx.c | ||
bcm54140.c | ||
bcm84881.c | ||
broadcom.c | ||
cicada.c | ||
cortina.c | ||
davicom.c | ||
dp83tc811.c | ||
dp83td510.c | ||
dp83640_reg.h | ||
dp83640.c | ||
dp83822.c | ||
dp83848.c | ||
dp83867.c | ||
dp83869.c | ||
et1011c.c | ||
fixed_phy.c | ||
icplus.c | ||
intel-xway.c | ||
Kconfig | ||
linkmode.c | ||
lxt.c | ||
Makefile | ||
marvell-88q2xxx.c | ||
marvell-88x2222.c | ||
marvell.c | ||
marvell10g.c | ||
mdio_bus.c | ||
mdio_device.c | ||
mdio_devres.c | ||
mdio-boardinfo.c | ||
mdio-boardinfo.h | ||
mdio-open-alliance.h | ||
mediatek-ge-soc.c | ||
mediatek-ge.c | ||
meson-gxl.c | ||
micrel.c | ||
microchip_t1.c | ||
microchip_t1s.c | ||
microchip.c | ||
mii_timestamper.c | ||
motorcomm.c | ||
mtip_backplane_phy.c | ||
mxl-gpy.c | ||
national.c | ||
ncn26000.c | ||
nxp-c45-tja11xx.c | ||
nxp-cbtx.c | ||
nxp-tja11xx.c | ||
phy_device.c | ||
phy_led_triggers.c | ||
phy-c45.c | ||
phy-core.c | ||
phy.c | ||
phylink.c | ||
qsemi.c | ||
realtek.c | ||
rockchip.c | ||
sfp-bus.c | ||
sfp.c | ||
sfp.h | ||
smsc.c | ||
spi_ks8995.c | ||
ste10Xp.c | ||
stubs.c | ||
swphy.c | ||
swphy.h | ||
teranetics.c | ||
uPD60620.c | ||
vitesse.c | ||
xilinx_gmii2rgmii.c |