DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/nfp: fix an out of bounds write problem
@ 2022-11-02  1:23 Chaoyong He
  2022-11-06  9:31 ` Andrew Rybchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Chaoyong He @ 2022-11-02  1:23 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Fix the check logic of the index of the array, which
caused the out of bounds write problem.

Coverity issue: 381616
Fixes: 0666af498761 ("net/nfp: support RSS based on VXLAN inner layer")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
index 463eb64b1d..71711bfa22 100644
--- a/drivers/net/nfp/nfp_common.c
+++ b/drivers/net/nfp/nfp_common.c
@@ -1386,7 +1386,7 @@ nfp_net_set_vxlan_port(struct nfp_net_hw *hw,
 	int ret;
 	uint32_t i;
 
-	if (idx > NFP_NET_N_VXLAN_PORTS) {
+	if (idx >= NFP_NET_N_VXLAN_PORTS) {
 		PMD_DRV_LOG(ERR, "The idx value is out of range.");
 		return -ERANGE;
 	}
-- 
2.29.3


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

* Re: [PATCH] net/nfp: fix an out of bounds write problem
  2022-11-02  1:23 [PATCH] net/nfp: fix an out of bounds write problem Chaoyong He
@ 2022-11-06  9:31 ` Andrew Rybchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Rybchenko @ 2022-11-06  9:31 UTC (permalink / raw)
  To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund

On 11/2/22 04:23, Chaoyong He wrote:
> Fix the check logic of the index of the array, which
> caused the out of bounds write problem.
> 
> Coverity issue: 381616
> Fixes: 0666af498761 ("net/nfp: support RSS based on VXLAN inner layer")
> 
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>

Applied to dpdk-next-net/main, thanks.


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

end of thread, other threads:[~2022-11-06  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02  1:23 [PATCH] net/nfp: fix an out of bounds write problem Chaoyong He
2022-11-06  9:31 ` Andrew Rybchenko

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