From: Haiyue Wang Date: Wed, 19 May 2021 07:59:33 +0000 (+0800) Subject: net/iavf: fix RSS key access out of bound X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8ce5678f28a80871c9f4ef41ef52ba206ef5a17f;p=dpdk.git net/iavf: fix RSS key access out of bound The array rss_key has size 'vf->vf_res->rss_key_size', the array index should be less than that. Cc: stable@dpdk.org Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Signed-off-by: Haiyue Wang Acked-by: Beilei Xing --- diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index a7ef7a6d4d..5290588b17 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -366,7 +366,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,