Skip to content

net: Move setting of netops to fix crash

David Yang linux-arm-kernel lkml netdev 1 version Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 15 repliesApplied 10/10

Patches in v1 All 10 applied

#Subject and filesSizeRepliesApplied
1/10net: hisilicon: hisi_femac: Move setting of netops to fix crashdrivers/net/ethernet/hisilicon/hisi_femac.c+2 -12 repliesApplied
2/10net: hisilicon: hip04_eth: Move setting of netops to fix crashdrivers/net/ethernet/hisilicon/hip04_eth.c+2 -11 replyApplied
3/10net: ethernet: actions: Move setting of netops to fix crashdrivers/net/ethernet/actions/owl-emac.c+2 -11 replyApplied
4/10net: ethernet: adi: Move setting of netops to fix crashdrivers/net/ethernet/adi/adin1140.c+2 -12 repliesApplied
5/10net: mv643xx: move setting of netops to fix crashdrivers/net/ethernet/marvell/mv643xx_eth.c+2 -21 replyApplied
6/10net: au1000: move setting of netops to fix crashdrivers/net/ethernet/amd/au1000_eth.c+2 -11 replyApplied
7/10net: ethoc: move setting of netops to fix crashdrivers/net/ethernet/ethoc.c+2 -12 repliesApplied
8/10net: ethernet: aeroflex: move setting of netops to fix crashdrivers/net/ethernet/aeroflex/greth.c+2 -12 repliesApplied
9/10net: ti: icssm-prueth: Move setting of netops to fix crashdrivers/net/ethernet/ti/icssm/icssm_prueth.c+2 -11 replyApplied
10/10microchip: lan865x: move setting of netops to fix crashdrivers/net/ethernet/microchip/lan865x/lan865x.c+2 -11 replyApplied

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMaxime ChevallierJijie ShaoCiprian RegusAndreas LarssonDaniel Machon
SeriesR-b
1/10R-b R-b
2/10R-b
3/10R-b R-b
4/10R-b R-b R-b
5/10R-b
6/10R-b
7/10R-b R-b
8/10R-b A-b
9/10R-b R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH net 00/10] net: Move setting of netops to fix crash

Commit ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion") put a netdev_need_ops_lock() check on the phy_attach_direct() path, in phy_link_topo_add_phy(). With CONFIG_NET_SHAPER enabled netdev_need_ops_lock() reads dev->netdev_ops->net_shaper_ops, so any driver that connects a PHY before assigning ndev->netdev_ops now dies with a NULL pointer dereference at probe time. The breakage showed up in v7.3-rc1.

ibm/emac was hit first and fixed by commit 7c9f391ec89c ("net: emac:
move setting of netops to fix crash"). These ten patches apply the same one-line move to the remaining in-tree drivers whose probe path attaches a PHY before filling in netdev_ops:

1. hisilicon/hisi_femac (crash reproduced on hardware)
2. hisilicon/hip04
3. actions/owl-emac
4. adi/adin1140
5. marvell/mv643xx_eth
6. amd/au1000_eth
7. ethoc
8. aeroflex/greth
9. ti/icssm-prueth
10. microchip/lan865x (attach happens inside oa_tc6_init())

Only patch 1 was reproduced and verified on hardware; patches 2-10 were found by source inspection and are neither build nor boot tested.

Note that ti/netcp_ethss and cavium/thunder_bgx attach a PHY to netdevs that never get a netdev_ops at all (dummy netdevs), so they cannot be fixed by reordering and are not addressed here.

David Yang (10):
net: hisilicon: hisi_femac: Move setting of netops to fix crash
net: hisilicon: hip04_eth: Move setting of netops to fix crash
net: ethernet: actions: Move setting of netops to fix crash
net: ethernet: adi: Move setting of netops to fix crash
net: mv643xx: move setting of netops to fix crash
net: au1000: move setting of netops to fix crash
net: ethoc: move setting of netops to fix crash
net: ethernet: aeroflex: move setting of netops to fix crash
net: ti: icssm-prueth: Move setting of netops to fix crash
microchip: lan865x: move setting of netops to fix crash

 drivers/net/ethernet/actions/owl-emac.c          | 3 ++-
 drivers/net/ethernet/adi/adin1140.c              | 3 ++-
 drivers/net/ethernet/aeroflex/greth.c            | 3 ++-
 drivers/net/ethernet/amd/au1000_eth.c            | 3 ++-
 drivers/net/ethernet/ethoc.c                     | 3 ++-
 drivers/net/ethernet/hisilicon/hip04_eth.c       | 3 ++-
 drivers/net/ethernet/hisilicon/hisi_femac.c      | 3 ++-
 drivers/net/ethernet/marvell/mv643xx_eth.c       | 4 ++--
 drivers/net/ethernet/microchip/lan865x/lan865x.c | 3 ++-
 drivers/net/ethernet/ti/icssm/icssm_prueth.c     | 3 ++-
 10 files changed, 20 insertions(+), 11 deletions(-)
Signature · 1 line
2.53.0