DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: ferruh.yigit@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [RFT] vmxnet3: coverity reported defect
Date: Fri, 6 Apr 2018 07:18:26 -0400	[thread overview]
Message-ID: <20180406111826.GA19958@hmswarspite.think-freely.org> (raw)
In-Reply-To: <20180405083618.61509f5d@xeon-e3>

On Thu, Apr 05, 2018 at 08:36:18AM -0700, Stephen Hemminger wrote:
> 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++;
>  
This looks reasonable to me, though my vmware instance is down at the moment, so
I'm unable to test
> 
> PS: the email for the VMXNET3 maintainer  Shrikrishna Khare <skhare@vmware.com> bounces.
> 
I think it needs to be updated to point at pv-drivers@vmware.com, thats what
they use in the kernel these days

Neil

      parent reply	other threads:[~2018-04-06 11:19 UTC|newest]

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

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=20180406111826.GA19958@hmswarspite.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stephen@networkplumber.org \
    /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).