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 53AFBA04F0 for ; Tue, 10 Dec 2019 16:00:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4C2E91B13C; Tue, 10 Dec 2019 16:00:05 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 0A7021B13C for ; Tue, 10 Dec 2019 16:00:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575990003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1TADeNAWM1YuKI2/Dipno3uhKKN3XXQ0M5pHPHkzmKk=; b=RiwzdhvyYIdmsNVg8GlRjOvZ4EOh+ZjHrbpCGO9G0N8RAVTaYA4SKR37e/qiGhUF/FPC2j DJfpC9ck2aGyNhu15JI0H8BktWSyQqAWdf/9teauZunG8SYXFH0jE2o/VmJ44wiZu2S+Sl cj3PYJtURn0oDo11HLFVZrO8fniw6fQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-85-xSLwqtVXNzSAbgAq14S3NQ-1; Tue, 10 Dec 2019 10:00:00 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 440A5477; Tue, 10 Dec 2019 14:59:59 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C52C5D9C5; Tue, 10 Dec 2019 14:59:57 +0000 (UTC) From: Kevin Traynor To: Xiao Zhang Cc: Xiaolong Ye , dpdk stable Date: Tue, 10 Dec 2019 14:58:36 +0000 Message-Id: <20191210145937.32755-2-ktraynor@redhat.com> In-Reply-To: <20191210145937.32755-1-ktraynor@redhat.com> References: <20191210145937.32755-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: xSLwqtVXNzSAbgAq14S3NQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/i40e: fix integer overflow' has been queued to LTS release 18.11.6 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" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/16/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/3fdea4b4e1b50cd8d5= f46e55510e728ab24294fc Thanks. Kevin. --- >From 3fdea4b4e1b50cd8d5f46e55510e728ab24294fc Mon Sep 17 00:00:00 2001 From: Xiao Zhang Date: Tue, 15 Oct 2019 13:29:19 +0800 Subject: [PATCH] net/i40e: fix integer overflow [ upstream commit 01c12d247e699887926d0b92a102201019b8cd1e ] 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 fixes the issue by removing the variable and using the expression directly since the variable is only used once. Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Xiao Zhang Reviewed-by: Xiaolong Ye --- drivers/net/i40e/i40e_rxtx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 4285f8420..9de88a9cc 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -2609,5 +2609,5 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) =09struct i40e_hw *hw =3D I40E_VSI_TO_HW(rxq->vsi); =09struct rte_eth_dev_data *data =3D pf->dev_data; -=09uint16_t buf_size, len; +=09uint16_t buf_size; =20 =09buf_size =3D (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) - @@ -2632,6 +2632,7 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) =09} =20 -=09len =3D hw->func_caps.rx_buf_chain_len * rxq->rx_buf_len; -=09rxq->max_pkt_len =3D RTE_MIN(len, data->dev_conf.rxmode.max_rx_pkt_len)= ; +=09rxq->max_pkt_len =3D +=09=09RTE_MIN((uint32_t)(hw->func_caps.rx_buf_chain_len * +=09=09=09rxq->rx_buf_len), data->dev_conf.rxmode.max_rx_pkt_len); =09if (data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { =09=09if (rxq->max_pkt_len <=3D ETHER_MAX_LEN || --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-10 14:49:39.245624830 +0000 +++ 0002-net-i40e-fix-integer-overflow.patch=092019-12-10 14:49:38.97945912= 9 +0000 @@ -1 +1 @@ -From 01c12d247e699887926d0b92a102201019b8cd1e Mon Sep 17 00:00:00 2001 +From 3fdea4b4e1b50cd8d5f46e55510e728ab24294fc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 01c12d247e699887926d0b92a102201019b8cd1e ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 09c01f67c..40fe4cd5a 100644 +index 4285f8420..9de88a9cc 100644 @@ -24 +25 @@ -@@ -2597,5 +2597,5 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) +@@ -2609,5 +2609,5 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) @@ -31 +32 @@ -@@ -2620,6 +2620,7 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) +@@ -2632,6 +2632,7 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) @@ -40 +41 @@ - =09=09if (rxq->max_pkt_len <=3D RTE_ETHER_MAX_LEN || + =09=09if (rxq->max_pkt_len <=3D ETHER_MAX_LEN ||