linux/drivers/net
Akiva Goldberger 3cb92b0ad7 net/mlx5: Discard command completions in internal error
[ Upstream commit db9b31aa9b ]

Fix use after free when FW completion arrives while device is in
internal error state. Avoid calling completion handler in this case,
since the device will flush the command interface and trigger all
completions manually.

Kernel log:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
...
RIP: 0010:refcount_warn_saturate+0xd8/0xe0
...
Call Trace:
<IRQ>
? __warn+0x79/0x120
? refcount_warn_saturate+0xd8/0xe0
? report_bug+0x17c/0x190
? handle_bug+0x3c/0x60
? exc_invalid_op+0x14/0x70
? asm_exc_invalid_op+0x16/0x20
? refcount_warn_saturate+0xd8/0xe0
cmd_ent_put+0x13b/0x160 [mlx5_core]
mlx5_cmd_comp_handler+0x5f9/0x670 [mlx5_core]
cmd_comp_notifier+0x1f/0x30 [mlx5_core]
notifier_call_chain+0x35/0xb0
atomic_notifier_call_chain+0x16/0x20
mlx5_eq_async_int+0xf6/0x290 [mlx5_core]
notifier_call_chain+0x35/0xb0
atomic_notifier_call_chain+0x16/0x20
irq_int_handler+0x19/0x30 [mlx5_core]
__handle_irq_event_percpu+0x4b/0x160
handle_irq_event+0x2e/0x80
handle_edge_irq+0x98/0x230
__common_interrupt+0x3b/0xa0
common_interrupt+0x7b/0xa0
</IRQ>
<TASK>
asm_common_interrupt+0x22/0x40

Fixes: 51d138c261 ("net/mlx5: Fix health error state handling")
Signed-off-by: Akiva Goldberger <agoldberger@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20240509112951.590184-6-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-16 13:39:26 +02:00
..
appletalk
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2023-12-13 18:36:35 +01:00
bonding bonding: remove print in bond_verify_device_path 2024-02-23 08:54:55 +01:00
caif
can can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds 2023-11-20 11:08:15 +01:00
dsa net: dsa: mv88e6xxx: Avoid EEPROM timeout without EEPROM on 88E6250-family switches 2024-06-16 13:39:22 +02:00
ethernet net/mlx5: Discard command completions in internal error 2024-06-16 13:39:26 +02:00
fddi
fjes fjes: fix memleaks in fjes_hw_setup 2024-02-23 08:54:30 +01:00
hamradio
hippi
hyperv hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed 2024-03-15 10:48:21 -04:00
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2023-11-08 17:26:38 +01:00
ipa
ipvlan ipvlan: add ipvlan_route_v6_outbound() helper 2023-11-28 16:56:22 +00:00
mctp
mdio
netdevsim
pcs net: pcs: xpcs: Return EINVAL in the internal methods 2024-04-13 13:01:43 +02:00
phy net: phy: fix phy_read_poll_timeout argument type in genphy_loopback 2024-03-26 18:21:36 -04:00
plip
ppp ppp_async: limit MRU to 64K 2024-02-23 08:54:58 +01:00
slip
team team: Fix use-after-free when an option instance allocation fails 2023-12-20 15:17:41 +01:00
usb net: usb: smsc95xx: stop lying about skb->truesize 2024-06-16 13:39:26 +02:00
vmxnet3
vxlan vxlan: drop packets from invalid src-address 2024-05-02 16:24:44 +02:00
wan drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() 2023-10-10 21:59:06 +02:00
wireguard wireguard: netlink: access device through ctx instead of peer 2024-04-10 16:18:43 +02:00
wireless wifi: mwl8k: initialize cmd->addr[] properly 2024-06-16 13:39:24 +02:00
wwan
xen-netback xen-netback: properly sync TX responses 2024-02-23 08:55:05 +01:00
bareudp.c
dummy.c
eql.c
geneve.c geneve: fix header validation in geneve[6]_xmit_skb 2024-04-17 11:15:14 +02:00
gtp.c net: gtp: Fix Use-After-Free in gtp_dellink 2024-05-02 16:24:45 +02:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:08:16 +01:00
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2023-11-28 16:56:25 +00:00
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: tap_open(): set sk_uid from current_fsuid() 2023-08-11 15:13:57 +02:00
thunderbolt.c net: thunderbolt: Fix TCPv6 GSO checksum calculation 2023-10-06 13:18:23 +02:00
tun.c tun: limit printing rate when illegal packet received by tun dev 2024-04-27 17:05:24 +02:00
veth.c net: veth: do not manipulate GRO when using XDP 2024-03-26 18:21:35 -04:00
virtio_net.c virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings 2024-02-23 08:54:51 +01:00
vrf.c
vsockmon.c
xen-netfront.c xen-netfront: Add missing skb_mark_for_recycle 2024-04-10 16:19:37 +02:00