From: Neil Horman Subject: Re: [RFT] vmxnet3: coverity reported defect Date: Fri, 6 Apr 2018 07:18:26 -0400 Message-ID: <20180406111826.GA19958@hmswarspite.think-freely.org> References: <20180405083618.61509f5d@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: ferruh.yigit@intel.com, dev@dpdk.org To: Stephen Hemminger Return-path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 38D9A4CA1 for ; Fri, 6 Apr 2018 13:19:11 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20180405083618.61509f5d@xeon-e3> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 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