[dpdk-dev] [PATCH] net/bonding:fix balance-xor link down stack overflow

jilei jilei8 at huawei.com
Tue Aug 10 08:43:23 CEST 2021


When slave link down, deactivate_slave will internals->active_slaves
and internals->active_slave_count.Active_slave in bond_ethdev_rx_burst
may out of range in internals->active_slaves.It will get bond's port_id
cause stack overflow

Cc: stable at dpdk.org
Signed-off-by: jilei <jilei8 at huawei.com>
---
 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 a6755661c4..46f2c42d60 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.23.0



More information about the dev mailing list