linux/drivers/net/ethernet
Cosmin Ratiu 4dbc1d1a9f net/mlx5e: Don't call cleanup on profile rollback failure
When profile rollback fails in mlx5e_netdev_change_profile, the netdev
profile var is left set to NULL. Avoid a crash when unloading the driver
by not calling profile->cleanup in such a case.

This was encountered while testing, with the original trigger that
the wq rescuer thread creation got interrupted (presumably due to
Ctrl+C-ing modprobe), which gets converted to ENOMEM (-12) by
mlx5e_priv_init, the profile rollback also fails for the same reason
(signal still active) so the profile is left as NULL, leading to a crash
later in _mlx5e_remove.

 [  732.473932] mlx5_core 0000:08:00.1: E-Switch: Unload vfs: mode(OFFLOADS), nvfs(2), necvfs(0), active vports(2)
 [  734.525513] workqueue: Failed to create a rescuer kthread for wq "mlx5e": -EINTR
 [  734.557372] mlx5_core 0000:08:00.1: mlx5e_netdev_init_profile:6235:(pid 6086): mlx5e_priv_init failed, err=-12
 [  734.559187] mlx5_core 0000:08:00.1 eth3: mlx5e_netdev_change_profile: new profile init failed, -12
 [  734.560153] workqueue: Failed to create a rescuer kthread for wq "mlx5e": -EINTR
 [  734.589378] mlx5_core 0000:08:00.1: mlx5e_netdev_init_profile:6235:(pid 6086): mlx5e_priv_init failed, err=-12
 [  734.591136] mlx5_core 0000:08:00.1 eth3: mlx5e_netdev_change_profile: failed to rollback to orig profile, -12
 [  745.537492] BUG: kernel NULL pointer dereference, address: 0000000000000008
 [  745.538222] #PF: supervisor read access in kernel mode
<snipped>
 [  745.551290] Call Trace:
 [  745.551590]  <TASK>
 [  745.551866]  ? __die+0x20/0x60
 [  745.552218]  ? page_fault_oops+0x150/0x400
 [  745.555307]  ? exc_page_fault+0x79/0x240
 [  745.555729]  ? asm_exc_page_fault+0x22/0x30
 [  745.556166]  ? mlx5e_remove+0x6b/0xb0 [mlx5_core]
 [  745.556698]  auxiliary_bus_remove+0x18/0x30
 [  745.557134]  device_release_driver_internal+0x1df/0x240
 [  745.557654]  bus_remove_device+0xd7/0x140
 [  745.558075]  device_del+0x15b/0x3c0
 [  745.558456]  mlx5_rescan_drivers_locked.part.0+0xb1/0x2f0 [mlx5_core]
 [  745.559112]  mlx5_unregister_device+0x34/0x50 [mlx5_core]
 [  745.559686]  mlx5_uninit_one+0x46/0xf0 [mlx5_core]
 [  745.560203]  remove_one+0x4e/0xd0 [mlx5_core]
 [  745.560694]  pci_device_remove+0x39/0xa0
 [  745.561112]  device_release_driver_internal+0x1df/0x240
 [  745.561631]  driver_detach+0x47/0x90
 [  745.562022]  bus_remove_driver+0x84/0x100
 [  745.562444]  pci_unregister_driver+0x3b/0x90
 [  745.562890]  mlx5_cleanup+0xc/0x1b [mlx5_core]
 [  745.563415]  __x64_sys_delete_module+0x14d/0x2f0
 [  745.563886]  ? kmem_cache_free+0x1b0/0x460
 [  745.564313]  ? lockdep_hardirqs_on_prepare+0xe2/0x190
 [  745.564825]  do_syscall_64+0x6d/0x140
 [  745.565223]  entry_SYSCALL_64_after_hwframe+0x4b/0x53
 [  745.565725] RIP: 0033:0x7f1579b1288b

Fixes: 3ef14e463f ("net/mlx5e: Separate between netdev objects and mlx5e profiles initialization")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-10-17 12:14:07 +02:00
..
3com
8390
actions
adaptec
adi net: ethernet: adi: adin1110: Fix some error handling path in adin1110_read_fifo() 2024-10-07 16:49:43 -07:00
aeroflex net: ethernet: aeroflex: fix potential memory leak in greth_start_xmit_gbit() 2024-10-15 09:59:20 -07:00
agere
alacritech net: alacritech: Partially revert "net: alacritech: Switch to use dev_err_probe()" 2024-09-03 15:28:57 -07:00
allwinner
alteon net: alteon: Convert tasklet API to new bottom half workqueue mechanism 2024-07-31 18:59:46 -07:00
altera
amazon net: ena: Extend customer metrics reporting support 2024-09-12 18:01:17 -07:00
amd net: amd: mvme147: Fix probe banner message 2024-10-09 12:45:51 +01:00
apm
apple net: apple: bmac: Use IRQF_NO_AUTOEN flag in request_irq() 2024-09-12 20:35:04 -07:00
aquantia net: atlantic: convert comma to semicolon 2024-09-06 18:05:53 -07:00
arc
asix
atheros net: ag71xx: remove dead code path 2024-09-13 19:53:47 -07:00
broadcom net: bcmasp: fix potential memory leak in bcmasp_xmit() 2024-10-15 17:10:27 -07:00
brocade bna: adjust 'name' buf size of bna_tcb and bna_ccb structures 2024-07-12 01:56:48 +01:00
cadence net: macb: Avoid 20s boot delay by skipping MDIO bus registration for fixed-link PHY 2024-10-15 10:40:47 -07:00
calxeda
cavium net: thunderx: Remove setting of RX software timestamp 2024-09-09 17:44:41 -07:00
chelsio cxgb4: Remove setting of RX software timestamp 2024-09-06 09:34:18 +01:00
cirrus net: cirrus: use u8 for addr to calm down sparse 2024-09-23 06:58:37 +00:00
cisco enic: Report some per queue statistics in ethtool 2024-09-13 21:17:12 -07:00
cortina
davicom net: dm9051: fix module autoloading 2024-08-27 14:26:04 -07:00
dec move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
dlink net: ethernet: dlink: replace deprecated macro 2024-08-14 12:20:55 +01:00
emulex be2net: Remove unused declarations 2024-09-03 15:38:22 -07:00
engleder tsnep: Remove setting of RX software timestamp 2024-09-03 15:17:48 -07:00
ezchip
faraday net: ftgmac100: fixed not check status from fixed phy 2024-10-09 17:56:55 -07:00
freescale net: enetc: disable NAPI after all rings are disabled 2024-10-11 15:45:11 -07:00
fujitsu
fungible net/funeth: Remove setting of RX software timestamp 2024-09-09 17:44:41 -07:00
google gve: Remove unused declaration gve_rx_alloc_rings() 2024-08-19 17:48:20 -07:00
hisilicon net: hns3: Remove setting of RX software timestamp 2024-09-03 15:17:48 -07:00
huawei net: hinic: use ethtool_sprintf/puts 2024-08-13 11:59:37 +02:00
i825xx
ibm net: ibm: emac: mal: add dcr_unmap to _remove 2024-10-09 19:27:09 -07:00
intel e1000e: change I219 (19) devices to ADP 2024-10-08 14:39:22 -07:00
litex
marvell octeontx2-af: Fix potential integer overflows on integer shifts 2024-10-15 13:32:22 +02:00
mediatek net: ethernet: mtk_eth_soc: fix memory corruption during fq dma init 2024-10-17 12:02:29 +02:00
mellanox net/mlx5e: Don't call cleanup on profile rollback failure 2024-10-17 12:14:07 +02:00
meta move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
micrel net: ks8851: Fix potential TX stall after interface reopen 2024-07-11 11:52:29 +02:00
microchip net: microchip: vcap api: Fix memory leaks in vcap_api_encode_rule_test() 2024-10-15 18:39:00 -07:00
microsoft dma-mapping updates for linux 6.12 2024-09-19 11:12:49 +02:00
moxa
mscc net: mscc: ocelot: Remove setting of RX software timestamp 2024-09-09 17:44:41 -07:00
myricom
natsemi
neterion
netronome move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ni
nvidia
nxp
oki-semi
packetengines move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
pasemi netdev_features: convert NETIF_F_LLTX to dev->lltx 2024-09-03 11:36:43 +02:00
pensando ionic: Allow XDP program to be hot swapped 2024-09-09 19:18:15 -07:00
qlogic qlcnic: make read-only const array key static 2024-09-11 16:00:54 -07:00
qualcomm netdev_features: convert NETIF_F_LLTX to dev->lltx 2024-09-03 11:36:43 +02:00
rdc
realtek move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
renesas net: ravb: Only advertise Rx/Tx timestamps if hardware supports it 2024-10-15 18:41:10 -07:00
rocker netdev_features: convert NETIF_F_NETNS_LOCAL to dev->netns_local 2024-09-03 11:36:43 +02:00
samsung
seeq net: seeq: Fix use after free vulnerability in ether3 Driver Due to Race Condition 2024-09-19 15:17:30 +02:00
sfc sfc: Don't invoke xdp_do_flush() from netpoll. 2024-10-03 15:42:00 -07:00
sgi
silan
sis
smsc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
socionext
stmicro net: stmmac: dwmac-tegra: Fix link bring-up sequence 2024-10-15 12:35:17 +02:00
sun net: sunvnet: use ethtool_sprintf/puts 2024-08-12 13:25:38 +01:00
sunplus
synopsys
tehuti netdev_features: convert NETIF_F_LLTX to dev->lltx 2024-09-03 11:36:43 +02:00
ti net: ti: icssg-prueth: Fix race condition for VLAN table access 2024-10-09 12:18:01 +01:00
toshiba netdev_features: convert NETIF_F_LLTX to dev->lltx 2024-09-03 11:36:43 +02:00
tundra
vertexcom net: vertexcom: mse102x: Use ETH_ZLEN 2024-08-29 11:39:35 -07:00
via
wangxun i2c-for-6.12-rc1 2024-09-23 14:34:19 -07:00
wiznet
xilinx net: xilinx: axienet: fix potential memory leak in axienet_start_xmit() 2024-10-15 10:59:23 -07:00
xircom
xscale ixp4xx_eth: Remove setting of RX software timestamp 2024-09-09 17:44:42 -07:00
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c net: ethernet: use ip_hdrlen() instead of bit shift 2024-08-11 04:41:15 +01:00
jme.h
Kconfig net: ethernet: oa_tc6: implement register write operation 2024-09-11 20:53:42 -07:00
korina.c
lantiq_etop.c net: ethernet: lantiq_etop: fix memory disclosure 2024-10-01 10:58:07 +02:00
lantiq_xrx200.c
Makefile net: ethernet: oa_tc6: implement register write operation 2024-09-11 20:53:42 -07:00
oa_tc6.c net: ethernet: oa_tc6: add helper function to enable zero align rx frame 2024-09-11 20:53:45 -07:00