linux-stable/drivers/net
David Arinzon fdfbf54d12 net: ena: Fix incorrect descriptor free behavior
[ Upstream commit bf02d9fe00 ]

ENA has two types of TX queues:
- queues which only process TX packets arriving from the network stack
- queues which only process TX packets forwarded to it by XDP_REDIRECT
  or XDP_TX instructions

The ena_free_tx_bufs() cycles through all descriptors in a TX queue
and unmaps + frees every descriptor that hasn't been acknowledged yet
by the device (uncompleted TX transactions).
The function assumes that the processed TX queue is necessarily from
the first category listed above and ends up using napi_consume_skb()
for descriptors belonging to an XDP specific queue.

This patch solves a bug in which, in case of a VF reset, the
descriptors aren't freed correctly, leading to crashes.

Fixes: 548c4940b9 ("net: ena: Implement XDP_TX action")
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: David Arinzon <darinzon@amazon.com>
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-17 11:15:15 +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: mt7530: trap link-local frames regardless of ST Port State 2024-04-17 11:15:15 +02:00
ethernet net: ena: Fix incorrect descriptor free behavior 2024-04-17 11:15:15 +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 drivers: net: convert to boolean for the mac_managed_pm flag 2024-04-10 16:19:40 +02:00
vmxnet3
vxlan
wan
wireguard wireguard: netlink: access device through ctx instead of peer 2024-04-10 16:18:43 +02:00
wireless wifi: ath11k: decrease MHI channel buffer length to 8KB 2024-04-13 13:01:43 +02:00
wwan
xen-netback xen-netback: properly sync TX responses 2024-02-23 08:55:05 +01:00
Kconfig
LICENSE.SRC
Makefile
Space.c
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 gtp: fix use-after-free and null-ptr-deref in gtp_newlink() 2024-03-06 14:38:48 +00:00
ifb.c
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
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: Fix xdp_rxq_info's queue_index when detaching 2024-03-06 14:38:45 +00: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