From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH] net/nfp: fix an out of bounds write problem
Date: Wed, 2 Nov 2022 09:23:49 +0800 [thread overview]
Message-ID: <20221102012349.26186-1-chaoyong.he@corigine.com> (raw)
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
next reply other threads:[~2022-11-02 1:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 1:23 Chaoyong He [this message]
2022-11-06 9:31 ` Andrew Rybchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221102012349.26186-1-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=niklas.soderlund@corigine.com \
--cc=oss-drivers@corigine.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).