From: Kai Ji <kai.ji@intel.com>
To: dev@dpdk.org
Cc: gakhil@marvell.com, stable@dpdk.org, Kai Ji <kai.ji@intel.com>
Subject: [dpdk-dev v1] examples/fips_validation: fix dangling pt.val after MCT test
Date: Fri, 6 Mar 2026 12:37:12 +0000 [thread overview]
Message-ID: <20260306123712.2448851-1-kai.ji@intel.com> (raw)
After fips_mct_sha_test() and fips_mct_shake_test() complete,
vec.pt.val is freed but left as a non-NULL dangling pointer.
Since vec is a file-scope global, the next SHA algorithm's AFT
test calls parse_uint8_hex_str(&vec.pt), which checks val->val
and calls rte_free() on the stale pointer, producing:
EAL: Error: Invalid memory
Fix by setting vec.pt.val to NULL after rte_free() at the end
of both MCT functions so the subsequent rte_free() guard in
parse_uint8_hex_str() skips the already-freed pointer.
Signed-off-by: Kai Ji <kai.ji@intel.com>
---
examples/fips_validation/main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index daf273bc85..cfb5f0124c 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -2610,6 +2610,7 @@ fips_mct_sha_test(void)
rte_free(md[i].val);
rte_free(vec.pt.val);
+ vec.pt.val = NULL;
rte_free(val.val);
return 0;
@@ -2698,6 +2699,7 @@ fips_mct_shake_test(void)
rte_free(md.val);
rte_free(vec.pt.val);
+ vec.pt.val = NULL;
rte_free(val.val);
return 0;
}
--
2.43.0
reply other threads:[~2026-03-06 12:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260306123712.2448851-1-kai.ji@intel.com \
--to=kai.ji@intel.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.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