Skip to content

Commit

Permalink
net/bonding: fix OOB access in other aggregator modes
Browse files Browse the repository at this point in the history
[ upstream commit dfbc596 ]

slave aggregator_port_id is in [0, RTE_MAX_ETHPORTS-1] range.
If RTE_MAX_ETHPORTS is > 8, we can hit out of bound accesses on
agg_bandwidth[] and agg_count[] arrays.

Fixes: 6d72657 ("net/bonding: add other aggregator modes")

Signed-off-by: Hui Zhao <zhaohui8@huawei.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Chas Williams <chas3@att.com>
  • Loading branch information
Hui Zhao authored and kevintraynor committed Dec 3, 2019
1 parent ca538e2 commit 47233bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/bonding/rte_eth_bond_8023ad.c
Expand Up @@ -669,8 +669,8 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id)
struct port *agg, *port;
uint16_t slaves_count, new_agg_id, i, j = 0;
uint16_t *slaves;
uint64_t agg_bandwidth[8] = {0};
uint64_t agg_count[8] = {0};
uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0};
uint64_t agg_count[RTE_MAX_ETHPORTS] = {0};
uint16_t default_slave = 0;
uint16_t mode_count_id;
uint16_t mode_band_id;
Expand Down

0 comments on commit 47233bb

Please sign in to comment.