Skip to contentSkip to conversation

net/ice: fix VSI array out of bounds

PATCH Applied Wang Jie 2 participants 2 messages May 12, 2021 Network drivers

lore
Share & tools
lore

Wang Jie

author
#0 lore raw

PATCH 1/1 net/ice: fix VSI array out of bounds

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

Fixes 50370662b727 ("net/ice: support device and queue ops")
---
 drivers/net/ice/ice_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/ice_ethdev.c +1 -1
index 3e60acc01a..65efb3e966 100644
@@ -3034,7 +3034,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,
Signature · 1 line
2.17.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Wang, Jie1X <[email protected]>
Sent: Wednesday, May 12, 2021 10:27 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Wang, Jie1X <[email protected]>
Subject: [PATCH] net/ice: fix VSI array out of bounds

Quoted 4 lines

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

Fixes 50370662b727 ("net/ice: support device and queue ops")
Quoted 2 lines

Applied to dpdk-next-net-intel.

Thanks
Qi