DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFT] vmxnet3: coverity reported defect
@ 2018-04-05 15:36 Stephen Hemminger
  2018-04-05 16:47 ` Ferruh Yigit
  2018-04-06 11:18 ` Neil Horman
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2018-04-05 15:36 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev

I noticed Coverity defect in DPDK number 124563 was assigned to me.

It looks like vmxnet3 driver code doesn't handle case where host incorrectly
sends a frame with out setting SOP bit in first segment. This would lead to
rxq->start_seq being NULL.

Maybe something like this would fix it.  I don't have VMware (or time) to test.

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 57557492e0f5..3118d94add90 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -813,6 +813,13 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 			RTE_ASSERT(rxd->btype == VMXNET3_RXD_BTYPE_BODY);
 
+			if (unlikely(start == NULL)) {
+				PMD_RX_LOG(ERR, "Missing sop");
+
+				rte_pktmbuf_free_seg(rxm);
+				goto rcd_done;
+			}
+
 			start->pkt_len += rxm->data_len;
 			start->nb_segs++;
 

PS: the email for the VMXNET3 maintainer  Shrikrishna Khare <skhare@vmware.com> bounces.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-06 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 15:36 [dpdk-dev] [RFT] vmxnet3: coverity reported defect Stephen Hemminger
2018-04-05 16:47 ` Ferruh Yigit
2018-04-06 11:18 ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).