From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f44.google.com (mail-pl0-f44.google.com [209.85.160.44]) by dpdk.org (Postfix) with ESMTP id 616DD1CC99 for ; Thu, 5 Apr 2018 17:36:21 +0200 (CEST) Received: by mail-pl0-f44.google.com with SMTP id v18-v6so17659169ply.12 for ; Thu, 05 Apr 2018 08:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version :content-transfer-encoding; bh=i9jlzjjDL+nxcxvKqEQH/hwHaHIDfi7BKF+GEQT1H50=; b=Us2BhYd7yUafCJ6NoJVtLyR5qtWy6Vxbc4Ndpa6rlLmtV/2STg40otydQJ3JPIAQRN o1vb+/17JYRD6XbwwAIDiyOFPTbjLg83xNn8cYQXiRGl4uIJIVT+LE4Gwu4PnXOG+fSL E9KQBLSCq+zQxoXdBNZ7ujYUc7uAYEx2TOCULALAcBVBrPnUK9vqDXcrJOoZpdDL90U3 iET2k5BrpJzH5H6fdV6+Uc+DysJn0NfvyGMi52YUsmIq2g3ePlWhnsvwQCp4XOLwzOcK HuurhYQKbXoUCdSNJhkqjQ5woPvxMpeLDLt1QyXmwfy+G1n2tU70vd4eostKSnxRwRxd pKzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-transfer-encoding; bh=i9jlzjjDL+nxcxvKqEQH/hwHaHIDfi7BKF+GEQT1H50=; b=E63tHky1XOsnWu7cAUDxVC12CoCXIz7UV/ok2bbEYDcIkzDfdEvGXDrDvCfaFLwhpQ 8dhWU9RPtjXDdG+sDbcFcZDaTaiiSdd8vuLlH+245clc/stm/eFN5gWEsDn3KAwMK5fl TBgEeb6sN8lxt/p0ZFhOXFcqV605BhevJt+UlRG64cVFLXPlCV0lAF27Nr7nkYXEB9S4 1Q/75bMvKL/WCel/MlgFwHBWqXo2kdFlp5Dgpl3YewZr0nBTSpaCDMscm/rkXFIiQ9yz B+2ab4qe5lMtad6WZDbJmofMr5a7FX7kPqSi2oqYrwe/nLVI3BTtbFu6kWkbLeqavGLY Q4UQ== X-Gm-Message-State: AElRT7E88oVT4XZ3nq5BkwJk518qUQtWKM/pQzBZnsy3caHasF8gH2Rd 1iaN7YlKH3twR5x8+zhB/lIPJ8rgoos= X-Google-Smtp-Source: AIpwx4/CCpuTXuhasCEdGuYEpIT7r3sUL7DQmNo7J4Uc+9C9gEJ7oB3PFuhV3lrX8bHUMgwQlIJYOw== X-Received: by 2002:a17:902:7084:: with SMTP id z4-v6mr24136619plk.395.1522942580545; Thu, 05 Apr 2018 08:36:20 -0700 (PDT) Received: from xeon-e3 (204-195-71-95.wavecable.com. [204.195.71.95]) by smtp.gmail.com with ESMTPSA id f22sm16869910pff.146.2018.04.05.08.36.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Apr 2018 08:36:20 -0700 (PDT) Date: Thu, 5 Apr 2018 08:36:18 -0700 From: Stephen Hemminger To: ferruh.yigit@intel.com Cc: dev@dpdk.org Message-ID: <20180405083618.61509f5d@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [RFT] vmxnet3: coverity reported defect X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 15:36:21 -0000 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 bounces.