From 8ce5678f28a80871c9f4ef41ef52ba206ef5a17f Mon Sep 17 00:00:00 2001 From: Haiyue Wang Date: Wed, 19 May 2021 15:59:33 +0800 Subject: [PATCH] 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 --- drivers/net/iavf/iavf_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.20.1