From 98e675a4e99367d05196581c8206c573aaa6cee1 Mon Sep 17 00:00:00 2001 From: Chaoyong He Date: Wed, 2 Nov 2022 09:23:49 +0800 Subject: [PATCH] net/nfp: fix out-of-bounds write for VXLAN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the check logic of the index of the array, which caused the out of bounds write problem. Coverity issue: 381616 Fixes: c55abf6141b1 ("net/nfp: support RSS on VXLAN inner layer") Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- 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; }