diff options
| author | Vladimir Oltean <[email protected]> | 2023-07-20 00:02:31 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2023-07-20 19:47:25 +0000 |
| commit | 1c613beaf877c0c0d755853dc62687e2013e55c4 (patch) | |
| tree | be1b4cb15b5788097c277e7840fe92acc8976f62 /drivers/net/ethernet/intel/igc/igc_main.c | |
| parent | Merge branch 'tcp-add-missing-annotations' (diff) | |
| download | kernel-1c613beaf877c0c0d755853dc62687e2013e55c4.tar.gz kernel-1c613beaf877c0c0d755853dc62687e2013e55c4.zip | |
net: phy: prevent stale pointer dereference in phy_init()
mdio_bus_init() and phy_driver_register() both have error paths, and if
those are ever hit, ethtool will have a stale pointer to the
phy_ethtool_phy_ops stub structure, which references memory from a
module that failed to load (phylib).
It is probably hard to force an error in this code path even manually,
but the error teardown path of phy_init() should be the same as
phy_exit(), which is now simply not the case.
Fixes: 55d8f053ce1b ("net: phy: Register ethtool PHY operations")
Link: https://lore.kernel.org/netdev/[email protected]/
Suggested-by: Russell King (Oracle) <[email protected]>
Signed-off-by: Vladimir Oltean <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
0 files changed, 0 insertions, 0 deletions
