From: Mark Bulatov <ms.bulatov7@gmail.com>
To: "Chaoyong He" <chaoyong.he@corigine.com>,
"Niklas Söderlund" <niklas.soderlund@corigine.com>
Cc: dev@dpdk.org, stable@dpdk.org, Mark Bulatov <ms.bulatov7@gmail.com>
Subject: [PATCH v3] net/nfp: fix uninit local var in nfp_pre_tun_table_check_del
Date: Thu, 19 Nov 2026 21:15:27 +0300 [thread overview]
Message-ID: <20261119181527.5195-1-ms.bulatov7@gmail.com> (raw)
In-Reply-To: <20261116171857.5306-1-ms.bulatov7@gmail.com>
find_entry is left uninitialized if no pre-tunnel slot is in
use, and is NULL if no slot matches this representor's MAC.
Either case is then dereferenced when computing nfp_mac_idx.
Initialize find_entry and fail the delete if no entry is found.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: d3c33bdf1f18 ("net/nfp: prepare for IPv4 UDP tunnel decap flow action")
Cc: stable@dpdk.org
Signed-off-by: Mark Bulatov <ms.bulatov7@gmail.com>
---
v3 changes: The check was moved to a higher level, and
the description was corrected.
v2 link:
https://patches.dpdk.org/project/dpdk/patch/20261116171857.5306-1-ms.bulatov7@gmail.com/
v2 changes: Correction of the Fixes tag and addition of find_entry
initialization at the point of declaration
v1 link:
https://patches.dpdk.org/project/dpdk/patch/20261113142207.5537-1-ms.bulatov7@gmail.com/
drivers/net/nfp/flower/nfp_flower_flow.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c
index ad0fe9a8ef..9dbf9b934a 100644
--- a/drivers/net/nfp/flower/nfp_flower_flow.c
+++ b/drivers/net/nfp/flower/nfp_flower_flow.c
@@ -3793,7 +3793,7 @@ nfp_pre_tun_table_check_del(struct nfp_flower_representor *repr,
uint16_t nfp_mac_idx;
struct nfp_flow_priv *priv;
struct nfp_pre_tun_entry *entry;
- struct nfp_pre_tun_entry *find_entry;
+ struct nfp_pre_tun_entry *find_entry = NULL;
struct nfp_fl_rule_metadata *nfp_flow_meta;
priv = repr->app_fw_flower->flow_priv;
@@ -3827,6 +3827,12 @@ nfp_pre_tun_table_check_del(struct nfp_flower_representor *repr,
}
}
+ if (find_entry == NULL) {
+ PMD_DRV_LOG(ERR, "Pre-tunnel table entry not found.");
+ ret = -EINVAL;
+ goto free_entry;
+ }
+
nfp_flow_meta = nfp_flow->payload.meta;
nfp_mac_idx = (find_entry->mac_index << 8) |
NFP_FLOWER_CMSG_PORT_TYPE_OTHER_PORT |
--
2.39.5
prev parent reply other threads:[~2026-11-20 10:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 17:18 [PATCH v2] net/nfp: fix uninit local var in nfp_pre_tun_table_check_del Mark Bulatov
2026-11-17 18:56 ` Stephen Hemminger
2026-11-19 18:15 ` Mark Bulatov [this message]
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=20261119181527.5195-1-ms.bulatov7@gmail.com \
--to=ms.bulatov7@gmail.com \
--cc=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=niklas.soderlund@corigine.com \
--cc=stable@dpdk.org \
/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