diff mbox series

net/ice: fix VSI array out of bounds

Message ID 20210512022722.4732-1-jie1x.wang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series net/ice: fix VSI array out of bounds | expand

Checks

Context Check Description
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-mellanox-Functional fail Functional Testing issues
ci/intel-Testing fail Testing issues
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/checkpatch success coding style OK

Commit Message

Jie Wang May 12, 2021, 2:27 a.m. UTC
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")

Signed-off-by: Wang Jie <jie1x.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Zhang, Qi Z May 12, 2021, 8:54 a.m. UTC | #1
> -----Original Message-----
> From: Wang, Jie1X <jie1x.wang@intel.com>
> Sent: Wednesday, May 12, 2021 10:27 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Wang, Jie1X <jie1x.wang@intel.com>
> Subject: [PATCH] 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")

Cc: stable@dpdk.org
> 
> Signed-off-by: Wang Jie <jie1x.wang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
diff mbox series

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 3e60acc01a..65efb3e966 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -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,