Skip to content

Commit

Permalink
net/ice: fix VSI array out of bounds access
Browse files Browse the repository at this point in the history
[ upstream commit d7ea27d ]

In the loop, when the index of array "vsi->rss_key" is equal
to "vsi->rss_key_size", the array will be accessed out of bounds.

Fixes: 5037066 ("net/ice: support device and queue ops")

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
jiewang-code authored and cpaelzer committed Jun 10, 2021
1 parent 3cda8f6 commit 950f65a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ice/ice_ethdev.c
Expand Up @@ -2507,7 +2507,7 @@ static int ice_init_rss(struct ice_pf *pf)
/* configure RSS key */
if (!rss_conf->rss_key) {
/* Calculate the default hash key */
for (i = 0; i <= vsi->rss_key_size; i++)
for (i = 0; i < vsi->rss_key_size; i++)
vsi->rss_key[i] = (uint8_t)rte_rand();
} else {
rte_memcpy(vsi->rss_key, rss_conf->rss_key,
Expand Down

0 comments on commit 950f65a

Please sign in to comment.