linux-stable/drivers/net
Vladimir Oltean 1c613beaf8 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: 55d8f053ce ("net: phy: Register ethtool PHY operations")
Link: https://lore.kernel.org/netdev/ZLaiJ4G6TaJYGJyU@shell.armlinux.org.uk/
Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20230720000231.1939689-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-07-20 12:47:25 -07:00
..
appletalk
arcnet
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-27 09:45:22 -07:00
caif
can can: mcp251xfd: __mcp251xfd_chip_set_mode(): increase poll timeout 2023-07-17 19:54:51 +02:00
dsa net: dsa: microchip: correct KSZ8795 static MAC table access 2023-07-17 07:43:11 +01:00
ethernet net: ethernet: mtk_eth_soc: always mtk_get_ib1_pkt_type 2023-07-19 21:15:04 -07:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154 Core WPAN changes: 2023-06-24 15:41:46 -07:00
ipa
ipvlan Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-27 09:45:22 -07:00
mctp
mdio
netdevsim netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() 2023-07-12 12:46:35 -07:00
pcs net: pcs: lynx: update PCS driver to use neg_mode 2023-06-22 19:41:01 -07:00
phy net: phy: prevent stale pointer dereference in phy_init() 2023-07-20 12:47:25 -07:00
plip
ppp pptp: Fix fib lookup calls. 2023-07-04 19:39:30 +01:00
pse-pd
slip
team
thunderbolt
usb net: usbnet: Fix WARNING in usbnet_start_xmit/usb_submit_urb 2023-07-13 20:37:23 -07:00
vmxnet3
vxlan
wan net: lapbether: only support ethernet devices 2023-06-15 08:55:22 +01:00
wireguard wireguard: timers: move to using timer_delete_sync 2023-07-03 09:17:52 +01:00
wireless wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set() 2023-07-12 17:52:37 -07:00
wwan Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
xen-netback asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c gtp: Fix use-after-free in __gtp_encap_destroy(). 2023-06-24 15:20:42 -07:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: macsec: fix double free of percpu stats 2023-06-15 11:41:01 +01:00
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c ntb_netdev: Fix module_init problem 2023-07-08 11:03:53 -04:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
tun.c
veth.c
virtio_net.c
vrf.c vrf: Fix lockdep splat in output path 2023-07-18 12:49:57 +02:00
vsockmon.c
xen-netfront.c