[dpdk-stable] patch 'net/i40e: fix integer overflow' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Tue Dec 10 15:58:36 CET 2019


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 rebasing
(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/3fdea4b4e1b50cd8d5f46e55510e728ab24294fc

Thanks.

Kevin.

---
>From 3fdea4b4e1b50cd8d5f46e55510e728ab24294fc Mon Sep 17 00:00:00 2001
From: Xiao Zhang <xiao.zhang at intel.com>
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 <xiao.zhang at intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye at intel.com>
---
 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)
 	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;
 
 	buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) -
@@ -2632,6 +2632,7 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq)
 	}
 
-	len = hw->func_caps.rx_buf_chain_len * rxq->rx_buf_len;
-	rxq->max_pkt_len = RTE_MIN(len, data->dev_conf.rxmode.max_rx_pkt_len);
+	rxq->max_pkt_len =
+		RTE_MIN((uint32_t)(hw->func_caps.rx_buf_chain_len *
+			rxq->rx_buf_len), data->dev_conf.rxmode.max_rx_pkt_len);
 	if (data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
 		if (rxq->max_pkt_len <= ETHER_MAX_LEN ||
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-10 14:49:39.245624830 +0000
+++ 0002-net-i40e-fix-integer-overflow.patch	2019-12-10 14:49:38.979459129 +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 at 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 @@
- 		if (rxq->max_pkt_len <= RTE_ETHER_MAX_LEN ||
+ 		if (rxq->max_pkt_len <= ETHER_MAX_LEN ||



More information about the stable mailing list