Skip to contentSkip to conversation

net: vmxnet: check fragment length during fragmentation

PATCH Superseded P J P 2 participants 4 messages Aug 2, 2016 – Aug 9, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

P J P

author
#0 lore raw

PATCH 1/1 net: vmxnet: check fragment length during fragmentation

From: Prasad J Pandit <[email protected]>

VMware VMXNET* NIC emulator supports packet fragmentation. While fragmenting a packet, it checks for more fragments based on packet length and current fragment length. It is susceptible to an infinite loop, if the current fragment length is zero. Add check to avoid it.

---
 hw/net/vmxnet_tx_pkt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/vmxnet_tx_pkt.c +1 -1
index 91e1e08..f4d0f5f 100644
@@ -544,7 +544,7 @@ static bool vmxnet_tx_pkt_do_sw_fragmentation(struct VmxnetTxPkt *pkt,
 
         fragment_offset += fragment_len;
 
-    } while (more_frags);
+    } while (fragment_len && more_frags);
 
     return true;
 }
Signature · 1 line
2.5.5
#1 lore raw
Quoted 19 lines · P J P

From: Prasad J Pandit <[email protected]>

VMware VMXNET* NIC emulator supports packet fragmentation. While fragmenting a packet, it checks for more fragments based on packet length and current fragment length. It is susceptible to an infinite loop, if the current fragment length is zero. Add check to avoid it.

---
  hw/net/vmxnet_tx_pkt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/vmxnet_tx_pkt.c +0 -0
index 91e1e08..f4d0f5f 100644

hw/net/vmxnet_tx_pkt.c static bool vmxnet_tx_pkt_do_sw_fragmentation(struct VmxnetTxPkt *pkt, · line 550

Quoted 8 lines
hw/net/vmxnet_tx_pkt.c +1 -1
@@ -544,7 +544,7 @@ static bool vmxnet_tx_pkt_do_sw_fragmentation(struct VmxnetTxPkt *pkt,
 
          fragment_offset += fragment_len;
 
-    } while (more_frags);
+    } while (fragment_len && more_frags);
 
      return true;
  }

The patch doesn't apply cleanly on HEAD, we now move this logic to hw/net/net_tx_pkt.c. Please resend on top of HEAD and cc Dmitry Fleytman <[email protected]>.

Thanks

author
#2 lore raw

Hello Jason,

+-- On Thu, 4 Aug 2016, Jason Wang wrote --+
| The patch doesn't apply cleanly on HEAD, we now move this logic to 
| hw/net/net_tx_pkt.c. Please resend on top of HEAD and cc Dmitry Fleytman 
| <[email protected]>.

I see, that explains why it did not show-up in search. I've sent a revised
patch v2. Nevertheless, the patch here would apply to Qemu versions <= 2.6.0.

Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F

#3 lore raw
Quoted 7 lines · P J P

Hello Jason,

+-- On Thu, 4 Aug 2016, Jason Wang wrote --+
| The patch doesn't apply cleanly on HEAD, we now move this logic to
| hw/net/net_tx_pkt.c. Please resend on top of HEAD and cc Dmitry Fleytman
| <[email protected]>.
Quoted 7 lines

I see, that explains why it did not show-up in search. I've sent a revised
patch v2. Nevertheless, the patch here would apply to Qemu versions <= 2.6.0.

Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F

Yes, I will cc stable this time. Please do it next time if you want the fix for stable too.

Thanks