DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: ferruh.yigit@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [RFT] vmxnet3: coverity reported defect
Date: Thu, 5 Apr 2018 08:36:18 -0700	[thread overview]
Message-ID: <20180405083618.61509f5d@xeon-e3> (raw)

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.

             reply	other threads:[~2018-04-05 15:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 15:36 Stephen Hemminger [this message]
2018-04-05 16:47 ` Ferruh Yigit
2018-04-06 11:18 ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180405083618.61509f5d@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).