From d7ea27d065ebe3206c0739c67bf66510c0ac79a1 Mon Sep 17 00:00:00 2001 From: Jie Wang Date: Wed, 12 May 2021 03:14:07 +0000 Subject: [PATCH] net/ice: fix VSI array out of bounds access 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: 50370662b727 ("net/ice: support device and queue ops") Cc: stable@dpdk.org Signed-off-by: Jie Wang Acked-by: Qi Zhang --- drivers/net/ice/ice_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index f742d07fc2..5fd5f99b6f 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3040,7 +3040,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, -- 2.20.1