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 3c589_cs: Fix an error handling path in tc589_probe() 2023-05-22 19:17:58 -07:00
8390 net: ethernet: 8390: ne2k-pci: use module_pci_driver() macro 2023-08-10 19:31:57 -07:00
actions
adaptec
adi net: ethernet: adi: adin1110: Fix uninitialized variable 2023-10-21 11:54:42 +01:00
aeroflex net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
agere et131x: Use pci_dev_id() to simplify the code 2023-08-13 12:30:39 +01:00
alacritech net: ethernet: slicoss: remove redundant increment of pointer data 2023-07-28 15:37:08 -07:00
allwinner
alteon
altera net: altera-tse: make ALTERA_TSE depend on HAS_IOMEM 2023-08-18 10:18:51 -07:00
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 net/macmace: Replace zero-length array with DECLARE_FLEX_ARRAY() helper 2023-08-01 14:46:21 -07:00
aquantia net: atlantic: Fix DMA mapping for PTP hwts ring 2024-02-16 19:10:47 +01:00
arc net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
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 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-07-20 15:52:55 -07:00
cadence net: macb: fix sleep inside spinlock 2023-09-12 14:58:44 +02:00
calxeda
cavium Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
chelsio chtls: fix tp->rcv_tstamp initialization 2023-11-20 11:59:01 +01:00
cirrus cirrus: cs89x0: fix the return value handle and remove redundant dev_warn() for platform_get_irq() 2023-08-02 12:10:39 -07:00
cisco
cortina net: ethernet: cortina: Fix MTU max setting 2023-11-28 17:19:51 +00:00
davicom net: dm9051: Use PTR_ERR_OR_ZERO() to simplify code 2023-08-23 18:57:30 -07:00
dec
dlink
emulex rtnetlink: remove redundant checks for nlattr IFLA_BRIDGE_MODE 2023-08-08 15:10:37 -07:00
engleder tsnep: Fix mapping for zero copy XDP_TX action 2024-02-16 19:10:48 +01:00
ezchip net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
faraday net: ftmac100: add multicast filtering possibility 2023-08-11 06:58:31 +01:00
freescale net: fec: Set mac_managed_pm during probe 2024-04-10 16:35:52 +02:00
fujitsu
fungible eth: add missing xdp.h includes in drivers 2023-08-03 08:38:07 -07:00
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 net: ethernet: litex: add support for 64 bit stats 2023-06-15 22:56:46 -07:00
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 net: move gso declarations and functions to their own files 2023-06-10 00:11:41 -07:00
natsemi
neterion ethernet: s2io: Use ether_addr_to_u64() to convert ethernet address 2023-08-09 15:26:49 -07:00
netronome nfp: flower: handle acti_netdevs allocation failure 2024-03-26 18:19:41 -04:00
ni net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
nvidia
nxp
oki-semi net: pch_gbe: Allow build on MIPS_GENERIC kernel 2023-06-08 19:18:32 -07:00
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 net: smsc: Use pci_dev_id() to simplify the code 2023-08-13 12:30:39 +01:00
socionext page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
stmicro net: stmmac: dwmac-starfive: Add support for JH7100 SoC 2024-04-13 13:07:29 +02:00
sun ethernet: ldmvsw: mark ldmvsw_open() static 2023-08-11 18:24:02 -07:00
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 net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
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 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-03 14:34:37 -07:00
lantiq_etop.c
lantiq_xrx200.c