DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: fix VSI array out of bounds
@ 2021-05-12  3:14 Jie Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jie Wang @ 2021-05-12  3:14 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, qi.z.zhang, stevex.yang, Wang Jie

From: Wang Jie <jie1x.wang@intel.com>

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(-)

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,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ice: fix VSI array out of bounds
  2021-05-12  2:27 Wang Jie
@ 2021-05-12  8:54 ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2021-05-12  8:54 UTC (permalink / raw)
  To: Wang, Jie1X, dev; +Cc: Yang, Qiming



> -----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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH] net/ice: fix VSI array out of bounds
@ 2021-05-12  2:27 Wang Jie
  2021-05-12  8:54 ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Jie @ 2021-05-12  2:27 UTC (permalink / raw)
  To: dev; +Cc: Qiming Yang, Qi Zhang, Wang Jie

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(-)

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,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-12  8:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12  3:14 [dpdk-dev] [PATCH] net/ice: fix VSI array out of bounds Jie Wang
  -- strict thread matches above, loose matches on Subject: below --
2021-05-12  2:27 Wang Jie
2021-05-12  8:54 ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).