From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 62604A00C2 for ; Thu, 3 Nov 2022 10:28:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E68B40694; Thu, 3 Nov 2022 10:28:11 +0100 (CET) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 2093640693 for ; Thu, 3 Nov 2022 10:28:10 +0100 (CET) Received: by mail-wm1-f42.google.com with SMTP id c3-20020a1c3503000000b003bd21e3dd7aso2875900wma.1 for ; Thu, 03 Nov 2022 02:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bt1b0RlzIKLp892V3wsXGtHfOxUKcrNDM6FO9QJ7s7E=; b=hGPeKw8ZS+j9HGgxih4fq1eFdnXkp38Nyz2BntLyWB8niIbMof5IBSF/XGAUTgoM4F /f8lwUcDb3R6VIugGMgNhUZKBWC3rWeDJhcE2SZiNBfJimYH5WjCr23A4ELGXEtirT9r Kw5lREBaX4L0sKWPWyG09bUZLKJeX2NRa8aW/gGUnikGUCf0szrjeO8sCrzz9+9AFba5 DhDwRqx67KkIJcNkFW/ZAgp2K5as/ieUhCtIfxKD+sH74k+NV+MRn4HIgfCiI2jcZCH4 WQO1C5bIKMjgtADu0maNpRBDZWrr+d5gdkl9tAoqMN7XpqIXhg4fgl5K5R74RgorUw+9 cMjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bt1b0RlzIKLp892V3wsXGtHfOxUKcrNDM6FO9QJ7s7E=; b=ewd2mqJtkYd+nbKu6OuQtPDS4Haydy6ZcHnAC0WhmDbBSSwUe0kjwXXpqilIwRVcfA Jtexp7H+DSnoFoQLraKJo70VPvz2Q+GLqi2lMy5flRnjNQF/Hod1v+B/zgRB5778KquE hzFPJOPVU8DZsxR5t9R6/X3CkROn8QBuGSEaFd5mMkEthtQ2auzeN2pCeMUPrVPR0hXc Jxx5GQJNbYdT2gyR6gEp18uAobEF3fno1TwcPPZpAQDrUGNjR6JLZN41MnUpFtiKQO3x /9C16by7hB+RdxEelfjRUWlADJCx5oWSdGorNMwZH93yElTgTgO28Ha+Akyw6sA5HZAn Etww== X-Gm-Message-State: ACrzQf3153pxFn0ug4uUn7OPMG0/dk1ImXK6fpNACzZM2XTRJR0jQFaR Ses6N+clrnCRoQKSlB2s8QBJvJyY4PPKzg== X-Google-Smtp-Source: AMsMyM6YzJbNQFViisEewizKSrD+d4C5pzbgi7yjPvKI1RJDl7L/omiy5tOvyqrnPB8cPM6mge4oOw== X-Received: by 2002:a05:600c:a0b:b0:3b4:f9a7:f79b with SMTP id z11-20020a05600c0a0b00b003b4f9a7f79bmr27925307wmp.99.1667467689833; Thu, 03 Nov 2022 02:28:09 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id u20-20020a05600c19d400b003b3365b38f9sm818051wmq.10.2022.11.03.02.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 02:28:08 -0700 (PDT) From: luca.boccassi@gmail.com To: Yunjian Wang Cc: Lei Ji , Min Hu , dpdk stable Subject: patch 'net/bonding: fix array overflow in Rx burst' has been queued to stable release 20.11.7 Date: Thu, 3 Nov 2022 09:26:22 +0000 Message-Id: <20221103092758.1099402-4-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221103092758.1099402-1-luca.boccassi@gmail.com> References: <20221103092758.1099402-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 20.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/05/22. 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 This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/1eaa5b679f39de15a1886712cb2d20e6dca618d4 Thanks. Luca Boccassi --- >From 1eaa5b679f39de15a1886712cb2d20e6dca618d4 Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Mon, 18 Jul 2022 21:08:44 +0800 Subject: [PATCH] net/bonding: fix array overflow in Rx burst [ upstream commit 007c5450dfa094f7e07ebee3610bcb3494ef842c ] In bond_ethdev_rx_burst() function, we check the validity of the 'active_slave' as this code: if (++active_slave == slave_count) active_slave = 0; However, the value of 'active_slave' maybe equal to 'slave_count', when a slave is down. This is wrong and it can cause buffer overflow. This patch fixes the issue by using '>=' instead of '=='. Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness") Signed-off-by: Lei Ji Signed-off-by: Yunjian Wang Acked-by: Min Hu (Connor) --- drivers/net/bonding/rte_eth_bond_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 4fa523201f..01ea83d988 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -82,7 +82,7 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) bufs + num_rx_total, nb_pkts); num_rx_total += num_rx_slave; nb_pkts -= num_rx_slave; - if (++active_slave == slave_count) + if (++active_slave >= slave_count) active_slave = 0; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-03 09:27:25.772738034 +0000 +++ 0004-net-bonding-fix-array-overflow-in-Rx-burst.patch 2022-11-03 09:27:25.301421048 +0000 @@ -1 +1 @@ -From 007c5450dfa094f7e07ebee3610bcb3494ef842c Mon Sep 17 00:00:00 2001 +From 1eaa5b679f39de15a1886712cb2d20e6dca618d4 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 007c5450dfa094f7e07ebee3610bcb3494ef842c ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index cd80a0af46..02c96f697d 100644 +index 4fa523201f..01ea83d988 100644