From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 922D1A2EFC for ; Mon, 14 Oct 2019 12:35:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 39F2E1C192; Mon, 14 Oct 2019 12:35:56 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 2AD611C122; Mon, 14 Oct 2019 12:35:52 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 295C6A705; Mon, 14 Oct 2019 10:35:51 +0000 (UTC) Received: from [10.36.116.66] (ovpn-116-66.ams2.redhat.com [10.36.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6E9360BEC; Mon, 14 Oct 2019 10:35:49 +0000 (UTC) To: Xiao Zhang , dev@dpdk.org Cc: beilei.xing@intel.com, qi.z.zhang@intel.com, stable@dpdk.org References: <1571041986-37562-1-git-send-email-xiao.zhang@intel.com> From: Kevin Traynor Message-ID: Date: Mon, 14 Oct 2019 11:35:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <1571041986-37562-1-git-send-email-xiao.zhang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 14 Oct 2019 10:35:51 +0000 (UTC) Subject: Re: [dpdk-stable] [dpdk-dev] net/i40e: fix integer overflow X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 14/10/2019 09:33, Xiao Zhang wrote: > When configuring i40e rx queue, the temporary variable to store max packet > length is not big enough which leads to integer overflow issue. This > patch is to fix the issue by changing the variable type from uint16_t > to uint32_t. > > Fixes: c511a96a34d7 ("mbuf: add accessors for data room and private > size") It should be Fixes: 4861cde46116 ("i40e: new poll mode driver") > Cc: stable@dpdk.org > > Signed-off-by: Xiao Zhang > --- > drivers/net/i40e/i40e_rxtx.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > index bfe161f..ca15b12 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -2596,7 +2596,8 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) > struct i40e_pf *pf = I40E_VSI_TO_PF(rxq->vsi); > struct i40e_hw *hw = I40E_VSI_TO_HW(rxq->vsi); > struct rte_eth_dev_data *data = pf->dev_data; > - uint16_t buf_size, len; > + uint16_t buf_size; > + uint32_t len; > You can just remove the variable, it's only used once. > buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) - > RTE_PKTMBUF_HEADROOM); >