linux-stable/drivers/net/ethernet
David Arinzon 2fc4d53ff0 net: ena: Set tx_info->xdpf value to NULL
[ Upstream commit 36a1ca01f0 ]

The patch mentioned in the `Fixes` tag removed the explicit assignment
of tx_info->xdpf to NULL with the justification that there's no need
to set tx_info->xdpf to NULL and tx_info->num_of_bufs to 0 in case
of a mapping error. Both values won't be used once the mapping function
returns an error, and their values would be overridden by the next
transmitted packet.

While both values do indeed get overridden in the next transmission
call, the value of tx_info->xdpf is also used to check whether a TX
descriptor's transmission has been completed (i.e. a completion for it
was polled).

An example scenario:
1. Mapping failed, tx_info->xdpf wasn't set to NULL
2. A VF reset occurred leading to IO resource destruction and
   a call to ena_free_tx_bufs() function
3. Although the descriptor whose mapping failed was freed by the
   transmission function, it still passes the check
     if (!tx_info->skb)

   (skb and xdp_frame are in a union)
4. The xdp_frame associated with the descriptor is freed twice

This patch returns the assignment of NULL to tx_info->xdpf to make the
cleaning function knows that the descriptor is already freed.

Fixes: 504fd6a539 ("net: ena: fix DMA mapping function issues in XDP")
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:19:32 +02:00
..
3com
8390
actions
adaptec
adi net: ethernet: adi: adin1110: Fix uninitialized variable 2023-10-21 11:54:42 +01:00
aeroflex
agere
alacritech
allwinner
alteon
altera
amazon net: ena: Set tx_info->xdpf value to NULL 2024-04-17 11:19:32 +02:00
amd net: pds_core: Fix possible double free in error handling path 2024-03-15 10:48:21 -04:00
apm net: xgene: Fix unused xgene_enet_of_match warning for !CONFIG_OF 2023-10-21 11:49:31 +01:00
apple
aquantia net: atlantic: Fix DMA mapping for PTP hwts ring 2024-02-16 19:10:47 +01:00
arc
asix
atheros ethernet: atheros: fix a memleak in atl1e_setup_ring_resources 2024-01-01 12:42:31 +00:00
broadcom bnxt_en: Reset PTP tx_avail after possible firmware reset 2024-04-17 11:19:29 +02:00
brocade
cadence
calxeda
cavium
chelsio chtls: fix tp->rcv_tstamp initialization 2023-11-20 11:59:01 +01:00
cirrus
cisco
cortina net: ethernet: cortina: Fix MTU max setting 2023-11-28 17:19:51 +00:00
davicom
dec
dlink
emulex
engleder tsnep: Fix mapping for zero copy XDP_TX action 2024-02-16 19:10:48 +01:00
ezchip
faraday
freescale net: fec: Set mac_managed_pm during probe 2024-04-10 16:35:52 +02:00
fujitsu
fungible
google gve: Fix skb truesize underestimation 2024-02-05 20:14:34 +00:00
hisilicon net: hns3: mark unexcuted loopback test result as UNEXECUTED 2024-04-10 16:35:43 +02:00
huawei net: hinic: Fix warning-hinic_set_vlan_fliter() warn: variable dereferenced before check 'hwdev' 2023-09-20 10:54:45 +01:00
i825xx
ibm ibmveth: Remove condition to recompute TCP header checksum. 2023-10-04 11:19:57 +01:00
intel ice: use relative VSI index for VFs instead of PF VSI number 2024-04-13 13:07:33 +02:00
litex
marvell octeontx2-af: Fix NIX SQ mode and BP config 2024-04-17 11:19:29 +02:00
mediatek net: ethernet: mtk_eth_soc: fix PPE hanging issue 2024-03-26 18:20:09 -04:00
mellanox net/mlx5e: Do not produce metadata freelist entries in Tx port ts WQE xmit 2024-04-17 11:19:31 +02:00
micrel net: ks8851: Handle softirqs at the end of IRQ thread to fix hang 2024-04-17 11:19:29 +02:00
microchip net: sparx5: fix wrong config being used when reconfiguring PCS 2024-04-17 11:19:31 +02:00
microsoft net: mana: Fix Rx DMA datasize and skb_over_panic 2024-04-10 16:35:49 +02:00
moxa
mscc net: mscc: ocelot: fix pMAC TX RMON stats for bucket 256-511 and above 2024-01-01 12:42:30 +00:00
myricom
natsemi
neterion
netronome nfp: flower: handle acti_netdevs allocation failure 2024-03-26 18:19:41 -04:00
ni
nvidia
nxp
oki-semi
packetengines
pasemi
pensando ionic: set adminq irq affinity 2024-04-13 13:07:30 +02:00
qlogic net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues 2024-01-10 17:16:52 +01:00
qualcomm net: qualcomm: rmnet: fix global oob in rmnet_policy 2024-01-25 15:35:56 -08:00
rdc
realtek r8169: skip DASH fw status checks when DASH is disabled 2024-04-10 16:35:53 +02:00
renesas net: ravb: Always update error counters 2024-04-10 16:35:57 +02:00
rocker
samsung
seeq
sfc sfc: fix a double-free bug in efx_probe_filters 2024-01-10 17:16:50 +01:00
sgi
silan
sis
smsc
socionext
stmicro net: stmmac: dwmac-starfive: Add support for JH7100 SoC 2024-04-13 13:07:29 +02:00
sun
sunplus
synopsys
tehuti
ti net: ethernet: ti: cpsw_new: enable mac_managed_pm to fix mdio 2024-02-23 09:25:15 +01:00
toshiba net: spider_net: Use size_add() in call to struct_size() 2023-11-20 11:58:57 +01:00
tundra
vertexcom
via
wangxun net: txgbe: fix i2c dev name cannot match clkdev 2024-04-10 16:35:52 +02:00
wiznet
xilinx net: ll_temac: platform_get_resource replaced by wrong function 2024-04-03 15:28:56 +02:00
xircom
xscale
Kconfig
Makefile
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
korina.c
lantiq_etop.c
lantiq_xrx200.c