linux/drivers/net/ethernet
Somnath Kotur f9eaf6d036 bnxt_en: Set DMA unmap len correctly for XDP_REDIRECT
[ Upstream commit 3cdf199d47 ]

When transmitting an XDP_REDIRECT packet, call dma_unmap_len_set()
with the proper length instead of 0.  This bug triggers this warning
on a system with IOMMU enabled:

WARNING: CPU: 36 PID: 0 at drivers/iommu/dma-iommu.c:842 __iommu_dma_unmap+0x159/0x170
RIP: 0010:__iommu_dma_unmap+0x159/0x170
Code: a8 00 00 00 00 48 c7 45 b0 00 00 00 00 48 c7 45 c8 00 00 00 00 48 c7 45 a0 ff ff ff ff 4c 89 45
b8 4c 89 45 c0 e9 77 ff ff ff <0f> 0b e9 60 ff ff ff e8 8b bf 6a 00 66 66 2e 0f 1f 84 00 00 00 00
RSP: 0018:ff22d31181150c88 EFLAGS: 00010206
RAX: 0000000000002000 RBX: 00000000e13a0000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ff22d31181150cf0 R08: ff22d31181150ca8 R09: 0000000000000000
R10: 0000000000000000 R11: ff22d311d36c9d80 R12: 0000000000001000
R13: ff13544d10645010 R14: ff22d31181150c90 R15: ff13544d0b2bac00
FS: 0000000000000000(0000) GS:ff13550908a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005be909dacff8 CR3: 0008000173408003 CR4: 0000000000f71ef0
PKRU: 55555554
Call Trace:
<IRQ>
? show_regs+0x6d/0x80
? __warn+0x89/0x160
? __iommu_dma_unmap+0x159/0x170
? report_bug+0x17e/0x1b0
? handle_bug+0x46/0x90
? exc_invalid_op+0x18/0x80
? asm_exc_invalid_op+0x1b/0x20
? __iommu_dma_unmap+0x159/0x170
? __iommu_dma_unmap+0xb3/0x170
iommu_dma_unmap_page+0x4f/0x100
dma_unmap_page_attrs+0x52/0x220
? srso_alias_return_thunk+0x5/0xfbef5
? xdp_return_frame+0x2e/0xd0
bnxt_tx_int_xdp+0xdf/0x440 [bnxt_en]
__bnxt_poll_work_done+0x81/0x1e0 [bnxt_en]
bnxt_poll+0xd3/0x1e0 [bnxt_en]

Fixes: f18c2b77b2 ("bnxt_en: optimized XDP_REDIRECT support")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250710213938.1959625-4-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-07-17 18:32:13 +02:00
..
3com 3c589_cs: Fix an error handling path in tc589_probe() 2023-05-30 14:03:33 +01:00
8390 ethernet: 8390: remove unnecessary check of mem 2022-09-29 11:05:23 +02:00
actions net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
adaptec net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
adi net: ethernet: adi: adin1110: Fix some error handling path in adin1110_read_fifo() 2024-10-17 15:22:20 +02:00
aeroflex net: ethernet: aeroflex: fix potential memory leak in greth_start_xmit_gbit() 2024-11-01 01:55:59 +01:00
agere net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
alacritech net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
allwinner net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
alteon net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
altera net: altera_tse: release phylink resources in tse_shutdown() 2022-11-24 09:34:43 +01:00
amazon net: ena: Fix DMA syncing in XDP path when SWIOTLB is on 2024-06-12 11:03:59 +02:00
amd amd-xgbe: align CL37 AN sequence as per databook 2025-07-10 15:59:48 +02:00
apm net: xgene-v2: remove incorrect ACPI_PTR annotation 2025-06-04 14:40:11 +02:00
apple net: apple: bmac: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-31 13:32:27 +01:00
aquantia net: atlantic: generate software timestamp just before the doorbell 2025-06-27 11:07:34 +01:00
arc net: arc: rockchip: fix emac mdio node support 2024-11-14 13:15:12 +01:00
asix net: ax88796c: Use skb_put_data() instead of skb_put/memcpy pair 2022-09-29 09:37:29 +02:00
atheros ethernet: atl1: Add missing DMA mapping error checks and count errors 2025-07-10 15:59:47 +02:00
broadcom bnxt_en: Set DMA unmap len correctly for XDP_REDIRECT 2025-07-17 18:32:13 +02:00
brocade bna: adjust 'name' buf size of bna_tcb and bna_ccb structures 2024-08-03 08:49:09 +02:00
cadence net: macb: Check return value of dma_set_mask_and_coherent() 2025-06-27 11:07:32 +01:00
calxeda net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
cavium ptp: convert remaining drivers to adjfine interface 2024-12-14 19:54:21 +01:00
chelsio cxgb4: fix memory leak in cxgb4_init_ethtool_filters() error path 2025-04-25 10:43:50 +02:00
cirrus net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
cisco enic: fix incorrect MTU comparison in enic_change_mtu() 2025-07-10 15:59:48 +02:00
cortina net: ethernet: cortina: Use TOE/TSO on all TCP 2025-06-27 11:07:35 +01:00
davicom net: davicom: fix UAF in dm9000_drv_remove 2025-02-21 13:49:23 +01:00
dec net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
dlink net: dlink: add synchronization for stats update 2025-06-27 11:07:33 +01:00
emulex emulex/benet: correct command version selection in be_cmd_get_stats() 2025-06-27 11:07:33 +01:00
engleder tsnep: Fix tsnep_request_irq() format-overflow warning 2023-11-28 17:06:56 +00:00
ezchip eth: switch to netif_napi_add_weight() 2022-05-08 11:33:57 +01:00
faraday net: ftgmac100: select FIXED_PHY 2025-06-27 11:07:29 +01:00
freescale dpaa2-eth: fix xdp_rxq_info leak 2025-07-10 15:59:52 +02:00
fujitsu net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
fungible net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
google gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO 2025-06-27 11:07:18 +01:00
hisilicon net: hns3: defer calling ptp_clock_register() 2025-05-09 09:41:42 +02:00
huawei net: hinic: Fix cleanup in create_rxqs/txqs() 2024-12-27 13:52:54 +01:00
i825xx net/sun3_82586: fix potential memory leak in sun3_82586_send_packet() 2024-11-01 01:56:03 +01:00
ibm ibmvnic: Fix hardcoded NUM_RX_STATS/NUM_TX_STATS with dynamic sizeof 2025-07-17 18:32:12 +02:00
intel igc: disable L1.2 PCI-E link substate to avoid performance issue 2025-07-10 15:59:48 +02:00
litex net: ethernet: litex: add support for 64 bit stats 2023-07-27 08:50:35 +02:00
marvell octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer() 2025-06-27 11:07:35 +01:00
mediatek driver: net: ethernet: mtk_star_emac: fix suspend/resume issue 2025-06-27 11:07:17 +01:00
mellanox net: mlx4: add SOF_TIMESTAMPING_TX_SOFTWARE flag when getting ts info 2025-06-27 11:07:34 +01:00
micrel net: ks8851: Fix potential TX stall after interface reopen 2024-07-18 13:18:38 +02:00
microchip net: lan743x: fix potential out-of-bounds write in lan743x_ptp_io_event_clock_get() 2025-06-27 11:07:39 +01:00
microsoft net/mana: fix warning in the writer of client oob 2025-06-04 14:40:16 +02:00
moxa net: moxa: fix endianness-related issues from 'sparse' 2022-09-06 10:24:42 +02:00
mscc net: mscc: ocelot: delete PVID VLAN when readding it as non-PVID 2025-05-09 09:41:40 +02:00
myricom myri10ge: Fix an error handling path in myri10ge_probe() 2022-12-31 13:32:56 +01:00
natsemi net/sonic: use dma_mapping_error() for error check 2023-03-30 12:49:09 +02:00
neterion ethernet: s2io: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-31 13:32:26 +01:00
netronome nfp: bpf: Add check for nfp_app_ctrl_msg_alloc() 2025-03-07 16:56:38 +01:00
ni net: ethernet: nixge: fix NULL dereference 2022-11-28 11:09:51 +00:00
nvidia forcedeth: Fix an error handling path in nv_probe() 2023-05-30 14:03:32 +01:00
nxp net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
oki-semi net: pch_gbe: fix pci device refcount leak while module exiting 2022-11-18 19:40:14 -08:00
packetengines net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
pasemi net: pasemi: Fix return type of pasemi_mac_start_tx() 2023-05-24 17:32:37 +01:00
pensando ionic: Prevent driver/fw getting out of sync on devcmd(s) 2025-06-27 11:07:38 +01:00
qlogic net: qede: Initialize qede_ll_ops with designated initializer 2025-05-22 14:10:06 +02:00
qualcomm qca_spi: Make driver probing reliable 2024-12-19 18:08:55 +01:00
rdc r6040: Fix kmemleak in probe and remove 2022-12-31 13:32:54 +01:00
realtek r8169: don't scan PHY addresses > 0 2025-06-04 14:40:16 +02:00
renesas net: sh_eth: Fix missing rtnl lock in suspend/resume path 2025-02-21 13:49:23 +01:00
rocker rocker: fix link status detection in rocker_carrier_init() 2024-12-14 19:54:45 +01:00
samsung net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
seeq net: seeq: Fix use after free vulnerability in ether3 Driver Due to Race Condition 2024-10-17 15:21:13 +02:00
sfc ptp: convert remaining drivers to adjfine interface 2024-12-14 19:54:21 +01:00
sgi net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
silan ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
sis net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
smsc net: smc91x: Fix m68k kernel compilation for ColdFire CPU 2024-06-12 11:02:56 +02:00
socionext net: netsec: Ignore 'phy-mode' on SynQuacer in DT mode 2023-08-11 12:08:16 +02:00
stmicro net: stmmac: make sure that ptp_rate is not 0 before configuring timestamping 2025-06-27 11:07:17 +01:00
sun nui: Fix dma_mapping_error() check 2025-07-10 15:59:49 +02:00
sunplus eth: sp7021: drop free_netdev() from spl2sw_init_netdev() 2022-11-10 16:27:33 -08:00
synopsys net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
tehuti net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
ti net: ethernet: ti: am65-cpsw: Lower random mac address error print to info 2025-06-04 14:40:26 +02:00
toshiba net: spider_net: Use size_add() in call to struct_size() 2023-11-20 11:51:52 +01:00
tundra ethernet: tundra: free irq when alloc ring failed in tsi108_open() 2022-11-10 15:39:08 +01:00
vertexcom net: vertexcom: mse102x: Return code for mse102x_rx_pkt_spi 2025-06-27 11:07:34 +01:00
via net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
wangxun net: ngbe: Add build support for ngbe 2022-08-30 12:32:51 +02:00
wiznet net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
xilinx net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam() 2025-07-17 18:32:13 +02:00
xircom xirc2ps_cs: Fix use after free bug in xirc2ps_detach 2023-03-30 12:49:04 +02:00
xscale net: xscale: Fix return type for implementation of ndo_start_xmit 2022-09-02 21:18:56 -07:00
dnet.c net: ethernet: dnet: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-31 13:32:27 +01:00
dnet.h net/dnet: Delete static version from the driver 2020-03-03 17:54:55 -08:00
ec_bhf.c ethernet: ec_bhf: use eth_hw_addr_set() 2021-10-16 08:53:46 +01:00
ethoc.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
fealnx.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
jme.c net: ethernet: use ip_hdrlen() instead of bit shift 2024-09-18 19:23:02 +02:00
jme.h jme: remove an unnecessary indirection 2022-05-05 15:53:28 -07:00
Kconfig net: restore alpha order to Ethernet devices in config 2024-03-06 14:45:04 +00:00
korina.c net: korina: handle clk prepare error in korina_probe() 2023-08-11 12:08:16 +02:00
lantiq_etop.c net: ethernet: lantiq_etop: fix memory disclosure 2024-10-17 15:21:32 +02:00
lantiq_xrx200.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
Makefile net: ethernet: adi: Add ADIN1110 support 2022-09-20 15:00:30 +02:00