Skip to content

Commit

Permalink
net/iavf: fix RSS key access out of bound
Browse files Browse the repository at this point in the history
[ upstream commit 8ce5678 ]

The array rss_key has size 'vf->vf_res->rss_key_size', the array index
should be less than that.

Fixes: 69dd4c3 ("net/avf: enable queue and device")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
  • Loading branch information
haiyuewa authored and cpaelzer committed Aug 9, 2021
1 parent 97f233a commit e818762
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/iavf/iavf_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ iavf_init_rss(struct iavf_adapter *adapter)
/* configure RSS key */
if (!rss_conf->rss_key) {
/* Calculate the default hash key */
for (i = 0; i <= vf->vf_res->rss_key_size; i++)
for (i = 0; i < vf->vf_res->rss_key_size; i++)
vf->rss_key[i] = (uint8_t)rte_rand();
} else
rte_memcpy(vf->rss_key, rss_conf->rss_key,
Expand Down

0 comments on commit e818762

Please sign in to comment.