From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6B768101B for ; Tue, 19 Sep 2017 13:51:55 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 19 Sep 2017 04:51:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,418,1500966000"; d="scan'208";a="137013405" Received: from unknown (HELO Sent) ([10.103.102.64]) by orsmga002.jf.intel.com with SMTP; 19 Sep 2017 04:51:50 -0700 Received: by Sent (sSMTP sendmail emulation); Tue, 19 Sep 2017 13:47:59 +0200 From: SebastianX Basierski To: skhare@vmware.com Cc: SebastianX Basierski , dev@dpdk.org Date: Tue, 19 Sep 2017 13:47:58 +0200 Message-Id: <1505821678-33651-1-git-send-email-sebastianx.basierski@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] pmd_vmxnet3: Unintentional integer overflow 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: Tue, 19 Sep 2017 11:51:55 -0000 Fixed overflow by casting txq->cmd_ring.next2fill to uint64_t type. Coverity issue: 143457 Fixes: 01fef6e3c181 ("net/vmxnet3: allow variable length Tx data ring") Cc: skhare@vmware.com cc: dev@dpdk.org Signed-off-by: SebastianX Basierski --- drivers/net/vmxnet3/vmxnet3_rxtx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index d9cf437..680da17 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -504,8 +504,9 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, */ gdesc = txq->cmd_ring.base + txq->cmd_ring.next2fill; if (copy_size) { - uint64 offset = txq->cmd_ring.next2fill * - txq->txdata_desc_size; + uint64 offset = + (uint64)txq->cmd_ring.next2fill * + txq->txdata_desc_size; gdesc->txd.addr = rte_cpu_to_le_64(txq->data_ring.basePA + offset); -- 2.7.4 -------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.