linux/drivers/net/ethernet
Somnath Kotur 11a39259ff bnxt_en: Check abort error state in bnxt_half_open_nic()
bnxt_half_open_nic() is called during during ethtool self test and is
protected by rtnl_lock.  Firmware reset can be happening at the same
time.  Only critical portions of the entire firmware reset sequence
are protected by the rtnl_lock.  It is possible that bnxt_half_open_nic()
can be called when the firmware reset sequence is aborting.  In that
case, bnxt_half_open_nic() needs to check if the ABORT_ERR flag is set
and abort if it is.  The ethtool self test will fail but the NIC will be
brought to a consistent IF_DOWN state.

Without this patch, if bnxt_half_open_nic() were to continue in this
error state, it may crash like this:

  bnxt_en 0000:82:00.1 enp130s0f1np1: FW reset in progress during close, FW reset will be aborted
  Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
  ...
  Process ethtool (pid: 333327, stack limit = 0x0000000046476577)
  Call trace:
  bnxt_alloc_mem+0x444/0xef0 [bnxt_en]
  bnxt_half_open_nic+0x24/0xb8 [bnxt_en]
  bnxt_self_test+0x2dc/0x390 [bnxt_en]
  ethtool_self_test+0xe0/0x1f8
  dev_ethtool+0x1744/0x22d0
  dev_ioctl+0x190/0x3e0
  sock_ioctl+0x238/0x480
  do_vfs_ioctl+0xc4/0x758
  ksys_ioctl+0x84/0xb8
  __arm64_sys_ioctl+0x28/0x38
  el0_svc_handler+0xb0/0x180
  el0_svc+0x8/0xc

Fixes: a1301f08c5 ("bnxt_en: Check abort error state in bnxt_open_nic().")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-19 08:25:44 -07:00
..
3com net: 3com: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
8390 net: 8390: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
actions
adaptec
aeroflex net: ethernet: aeroflex: fix UAF in greth_of_remove 2021-06-19 11:45:10 -07:00
agere
alacritech
allwinner
alteon net: alteon: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
altera
amazon Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
amd net: amd: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
apm
apple net: apple: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
aquantia net: atlantic: fix the macsec key length 2021-06-24 12:41:13 -07:00
arc
atheros atl1c: fix Mikrotik 10/25G NIC detection 2021-07-08 13:31:43 -07:00
broadcom bnxt_en: Check abort error state in bnxt_half_open_nic() 2021-07-19 08:25:44 -07:00
brocade
cadence net: macb: Use devm_platform_get_and_ioremap_resource() 2021-06-07 14:07:22 -07:00
calxeda
cavium liquidio: Fix unintentional sign extension issue on left shift of u16 2021-07-15 10:27:33 -07:00
chelsio cxgb4: fix IRQ free race during driver unload 2021-07-08 13:34:13 -07:00
cirrus
cisco
cortina net: gemini: Use devm_platform_get_and_ioremap_resource() 2021-06-07 13:20:00 -07:00
davicom
dec net: tulip: Remove the repeated declaration 2021-06-07 14:03:11 -07:00
dlink net: dlink: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
emulex Revert "be2net: disable bh with spin_lock in be_process_mcc" 2021-06-25 11:44:16 -07:00
ezchip net: ethernet: ezchip: fix error handling 2021-06-19 11:46:00 -07:00
faraday net: ftgmac100: add missing error return code in ftgmac100_probe() 2021-05-23 16:16:24 -07:00
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
fujitsu Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
google gve: DQO: Remove incorrect prefetch 2021-07-02 12:06:17 -07:00
hisilicon net: hns3: add support for dumping MAC umv counter in debugfs 2021-06-28 13:34:58 -07:00
huawei
i825xx
ibm ibmvnic: retry reset if there are no other resets 2021-07-01 13:11:12 -07:00
intel Networking fixes for 5.14-rc2, including fixes from bpf and netfilter. 2021-07-14 09:24:32 -07:00
marvell Networking fixes for 5.14-rc2, including fixes from bpf and netfilter. 2021-07-14 09:24:32 -07:00
mediatek net: ethernet: mtk_eth_soc: Fix packet statistics support for MT7628/88 2021-05-23 16:13:11 -07:00
mellanox More fallthrough fixes for Clang for 5.14-rc1 2021-07-07 11:03:04 -07:00
micrel net: phy: micrel: move phy reg offsets to common header 2021-06-14 12:54:43 -07:00
microchip net: microchip: sparx5: fix kconfig warning 2021-07-08 13:59:29 -07:00
microsoft Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-29 15:45:27 -07:00
moxa net: moxa: fix UAF in moxart_mac_probe 2021-07-09 11:01:01 -07:00
mscc net: ocelot: fix switchdev objects synced for wrong netdev with LAG offload 2021-07-13 09:30:46 -07:00
myricom ethernet: myri10ge: Fix missing error code in myri10ge_probe() 2021-06-01 15:54:38 -07:00
natsemi net: natsemi: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
neterion Networking changes for 5.14. 2021-06-30 15:51:09 -07:00
netronome nfp: flower-ct: remove callback delete deadlock 2021-07-02 13:36:35 -07:00
ni net: nixge: simplify code with devm platform functions 2021-06-08 16:36:57 -07:00
nvidia
nxp
oki-semi
packetengines
pasemi
pensando
qlogic qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union() 2021-07-15 12:35:38 -07:00
qualcomm net: qcom/emac: fix UAF in emac_remove 2021-07-09 11:01:01 -07:00
rdc net: r6040: Allow restarting auto-negotiation 2021-05-23 17:23:59 -07:00
realtek Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
renesas Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
rocker
samsung
seeq net: seeq: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
sfc sfc: add logs explaining XDP_TX/REDIRECT is not available 2021-07-13 10:02:41 -07:00
sgi net: sgi: ioc3-eth: check return value after calling platform_get_resource() 2021-06-09 15:24:43 -07:00
silan
sis net: sis: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
smsc net: smsc: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
socionext netsec: Remove rcu_read_lock() around XDP program invocation 2021-06-24 19:46:12 +02:00
stmicro stmmac: platform: Fix signedness bug in stmmac_probe_config_dt() 2021-07-07 13:43:50 -07:00
sun Char / Misc driver updates for 5.14-rc1 2021-07-05 13:42:16 -07:00
synopsys
tehuti
ti net: ti: fix UAF in tlan_remove_one 2021-07-09 11:01:01 -07:00
toshiba
tundra
via
wiznet net: w5100: Use devm_platform_get_and_ioremap_resource() 2021-06-10 13:53:13 -07:00
xilinx net: ll_temac: Remove left-over debug message 2021-06-21 14:44:09 -07:00
xircom net: xircom: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
xscale ARM: SoC changes for 5.14 2021-07-10 09:22:44 -07:00
dnet.c
dnet.h
ec_bhf.c net: ethernet: fix potential use-after-free in ec_bhf_remove 2021-06-18 13:01:17 -07:00
ethoc.c
fealnx.c net: fealnx: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
jme.c
jme.h
Kconfig
korina.c
lantiq_etop.c
lantiq_xrx200.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
Makefile