Skip to contentSkip to conversation

igbvf: fix DMA mapping leak on Tx error

PATCH In review [email protected] 3 participants 3 messages Jul 21 – Jul 30

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igbvf: fix DMA mapping leak on Tx error

From: Xuanqiang Luo <[email protected]>

When mapping a fragmented skb fails, count already matches the number of successful mappings that must be undone. Decrementing it before the cleanup loop leaves one mapping active. Reusing the descriptor then overwrites its DMA address and loses the mapping.

Remove the extra decrement so the error path unmaps every successful mapping.

Fixes c1fa347f20f1 ("e1000/e1000e/igb/igbvf/ixgb/ixgbe: Fix tests of unsigned in *_tx_map()")
---
 drivers/net/ethernet/intel/igbvf/netdev.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/intel/igbvf/netdev.c +0 -2
index c5ae15fcdca75..3d2aba5c3f126 100644
@@ -2190,8 +2190,6 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
 	buffer_info->time_stamp = 0;
 	buffer_info->length = 0;
 	buffer_info->mapped_as_page = false;
-	if (count)
-		count--;
 
 	/* clear timestamp and dma mappings for remaining portion of packet */
 	while (count--) {
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 48 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of [email protected]
Sent: Tuesday, July 21, 2026 11:23 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Xuanqiang Luo <[email protected]>; [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-net v1] igbvf: fix DMA mapping leak on Tx error

From: Xuanqiang Luo <[email protected]>

When mapping a fragmented skb fails, count already matches the number of successful mappings that must be undone. Decrementing it before the cleanup loop leaves one mapping active. Reusing the descriptor then overwrites its DMA address and loses the mapping.

Remove the extra decrement so the error path unmaps every successful mapping.

Fixes c1fa347f20f1 ("e1000/e1000e/igb/igbvf/ixgb/ixgbe: Fix tests of

unsigned in *_tx_map()")

---
 drivers/net/ethernet/intel/igbvf/netdev.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/intel/igbvf/netdev.c +0 -2
index c5ae15fcdca75..3d2aba5c3f126 100644
@@ -2190,8 +2190,6 @@ static inline int igbvf_tx_map_adv(struct
 igbvf_adapter *adapter,
 	buffer_info->time_stamp = 0;
 	buffer_info->length = 0;
 	buffer_info->mapped_as_page = false;
-	if (count)
-		count--;
 
 	/* clear timestamp and dma mappings for remaining portion of
Quoted 4 lines

packet */
while (count--) {
--
2.43.0

maintainer
#2 lore raw
In reply to [email protected]
Quoted 9 lines · On 7/21/2026 2:23 AM, [email protected] wrote:

From: Xuanqiang Luo <[email protected]>

When mapping a fragmented skb fails, count already matches the number of successful mappings that must be undone. Decrementing it before the cleanup loop leaves one mapping active. Reusing the descriptor then overwrites its DMA address and loses the mapping.

Remove the extra decrement so the error path unmaps every successful mapping.

Thanks for the patch Xuanqiang, but we had one submitted for this already.

https://lore.kernel.org/intel-wired-lan/[email protected]/

Thanks,
Tony

Quoted 20 lines
Fixes c1fa347f20f1 ("e1000/e1000e/igb/igbvf/ixgb/ixgbe: Fix tests of unsigned in *_tx_map()")
---
  drivers/net/ethernet/intel/igbvf/netdev.c | 2 --
  1 file changed, 2 deletions(-)
drivers/net/ethernet/intel/igbvf/netdev.c +0 -2
index c5ae15fcdca75..3d2aba5c3f126 100644
@@ -2190,8 +2190,6 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
  	buffer_info->time_stamp = 0;
  	buffer_info->length = 0;
  	buffer_info->mapped_as_page = false;
-	if (count)
-		count--;
 
  	/* clear timestamp and dma mappings for remaining portion of packet */
  	while (count--) {