examples/fips_validation: fix dangling pointer for SHA test
PATCH 1/1 examples/fips_validation: fix dangling pointer for SHA test
Set vector pointer to NULL after free to avoid calling rte_free() on the same pointer twice in some cases.
--- examples/fips_validation/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/fips_validation/main.c +1 -1
@@ -2612,7 +2612,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 ; }
Signature · 1 line
2.34.1
Quoted 13 lines
Set vector pointer to NULL after free to avoid calling
rte_free()on the same pointer twice in some cases.Signed-off-by Emma Finn <[email protected]>--- examples/fips_validation/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)examples/fips_validation/main.c +0
-0
examples/fips_validation/main.c fips_mct_sha_test(void) · line 2615
Quoted 5 lines
examples/fips_validation/main.c +1
-1@@ -2612,7 +2612,7 @@ fips_mct_sha_test(void)rte_free (md[i].val);rte_free (vec.pt.val); - + vec.pt.val =NULL ;
Same could be the case for fips_mct_shake_test also.
Thanks,
Gowrishankar
Quoted 5 lines
examples/fips_validation/main.c +0
-1rte_free (val.val);return 0 ; } --2.34.1
Quoted 23 lines
-----Original Message-----
From: Gowrishankar Muthukrishnan <[email protected]>
Sent: Thursday 28 August 2025 10:42
To: Finn, Emma <[email protected]>
Cc: [email protected]; Ji, Kai <[email protected]>
Subject: RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA testQuoted 15 lines
Set vector pointer to NULL after free to avoid calling
rte_free()on the same pointer twice in some cases.Signed-off-by Emma Finn <[email protected]>--- examples/fips_validation/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/examples/fips_validation/main.cindexf21826e9d7..60ee9f8dd4100644examples/fips_validation/main.c +0
-0@@ -2612,7 +2612,7 @@ fips_mct_sha_test(void)rte_free (md[i].val);
Quoted 6 lines
examples/fips_validation/main.c fips_mct_sha_test(void) · line 2615
Quoted 3 lines
examples/fips_validation/main.c +1
-1rte_free (vec.pt.val); - + vec.pt.val =NULL ;Same could be the case for
fips_mct_shake_testalso.
Good catch, probably the same could happen with shake.
I currently don’t have a way to test shake but I'm happy to make the change as part of this patch if you can test?
Thanks,
Emma
Quoted 7 lines
Thanks,
GowrishankarQuoted 5 lines
examples/fips_validation/main.c +0
-1rte_free (val.val);return 0 ; } --2.34.1
Quoted 10 lines
Quoted 6 lines
examples/fips_validation/main.c fips_mct_sha_test(void) · line 2615
Quoted 3 lines
examples/fips_validation/main.c +1
-1rte_free (vec.pt.val); - + vec.pt.val =NULL ;Same could be the case for
fips_mct_shake_testalso.Good catch, probably the same could happen with shake.
I currently don’t have a way to test shake but I'm happy to make the change as part of this patch if you can test?
Did you find any segfault and so got to know the problem ? If so, what was the command you executed ?.
Thanks,
Gowrishankar
Quoted 20 lines
-----Original Message-----
From: Gowrishankar Muthukrishnan <[email protected]>
Sent: Friday 29 August 2025 11:23
To: Finn, Emma <[email protected]>
Cc: [email protected]; Ji, Kai <[email protected]>
Subject: RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
Importance: HighQuoted 10 lines
Quoted 6 lines
examples/fips_validation/main.c fips_mct_sha_test(void) · line 2615
Quoted 3 lines
examples/fips_validation/main.c +1
-1rte_free (vec.pt.val); - + vec.pt.val =NULL ;Same could be the case for
fips_mct_shake_testalso.Good catch, probably the same could happen with shake.
I currently don’t have a way to test shake but I'm happy to make the change as part of this patch if you can test?
Quoted 5 lines
Did you find any segfault and so got to know the problem ? If so, what was the command you executed ?.
Thanks,
Gowrishankar
Running fips sample app with aesni_mb and SHA ACVP test vector files. Also occurs with QAT. ./dpdk-fips_validation --vdev=crypto_aesni_mb -- --req-file $FIPS_DIR/$alg/req --rsp-file $FIPS_DIR/$alg/resp_aesni_mb --path-is-folder
Output shows invalid memory bug.
EAL: Detected CPU lcores: 64
EAL: Detected NUMA nodes: 2
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized
EAL: Using IOMMU type 1 (Type 1)
CRYPTODEV: Creating cryptodev crypto_aesni_mb
CRYPTODEV: Initialisation parameters - name: crypto_aesni_mb,socket id: 0, max queue pairs: 8IPSEC_MB: ipsec_mb_create() line 168: IPSec Multi-buffer library version used: 2.0.0
EAL: Error: Invalid memory
SHAKE is not supported by these hence I did not catch it.
Thanks,
Emma
Quoted 1 line
SHAKE is not supported by these hence I did not catch it.
OpenSSL PMD supports SHA and SHAKE. Could that help verifying both lines of fix ?.
Thanks,
Gowrishankar.
Quoted 11 lines
-----Original Message-----
From: Gowrishankar Muthukrishnan <[email protected]>
Sent: Friday 29 August 2025 13:17
To: Finn, Emma <[email protected]>
Cc: [email protected]; Ji, Kai <[email protected]>
Subject: RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
Importance: High
Quoted 7 lines
Quoted 1 line
SHAKE is not supported by these hence I did not catch it.
OpenSSL PMD supports SHA and SHAKE. Could that help verifying both lines of fix ?.
Thanks,
Gowrishankar.
OpenSSL PMD only supports SHAKE-256 for EdDSA operations, not as standalone hash functions
Hi Gowrishankar,
Have you get a chance to test this patch against SHAKE on your ends ?
Regards
Kai
________________________________
From: Finn, Emma <[email protected]>
Sent: Friday, August 29, 2025 14:14
To: Gowrishankar Muthukrishnan <[email protected]>
Cc: [email protected] <[email protected]>; Ji, Kai <[email protected]>
Subject: RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
Quoted 9 lines
-----Original Message-----
From: Gowrishankar Muthukrishnan <[email protected]>
Sent: Friday 29 August 2025 13:17
To: Finn, Emma <[email protected]>
Cc: [email protected]; Ji, Kai <[email protected]>
Subject: RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
Importance: High
Quoted 7 lines
Quoted 1 line
SHAKE is not supported by these hence I did not catch it.
OpenSSL PMD supports SHA and SHAKE. Could that help verifying both lines of fix ?.
Thanks,
Gowrishankar.
OpenSSL PMD only supports SHAKE-256 for EdDSA operations, not as standalone hash functions
Hi,
I see example app runs normally with openssl PMD in my local tests, even without fix.
Thanks,
Gowrishankar
From: Ji, Kai <[email protected]>
Sent: Wednesday, October 15, 2025 9:23 PM
To: Finn, Emma <[email protected]>; Gowrishankar Muthukrishnan <[email protected]>
Cc: [email protected]
Subject: Re: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
Hi Gowrishankar, Have you get a chance to test this patch against SHAKE on your ends ? Regards Kai From: Finn, Emma <emma. finn@ intel. com> Sent: Friday, August 29, 2025 14: 14 To: Gowrishankar Muthukrishnan <gmuthukrishn@ marvell. com> ZjQcmQRYFpfptBannerStart
Prioritize security for external emails:
Confirm sender and content safety before clicking links or opening attachments
Report Suspicious <https://us-phishalarm-ewt.proofpoint.com/EWT/v1/CRVmXkqW!ui3XGZ9YrjX626H8WV37YM2aa0G6UhN-cKsdbpw7pqWvplKrDOohK8dxT6B9_RqNiV6uMomo_2pTJiWsEIfe_ZdA07-kBAy14DcmaeM7eRLbMeeoTtyqbMs3d2Q0-a5r77yEbIlkHnqjs8o$>
ZjQcmQRYFpfptBannerEnd
Hi Gowrishankar,
Have you get a chance to test this patch against SHAKE on your ends ?
Regards
Kai
________________________________
From: Finn, Emma <[email protected]<mailto:[email protected]>>
Sent: Friday, August 29, 2025 14:14
To: Gowrishankar Muthukrishnan <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; Ji, Kai <[email protected]<mailto:[email protected]>>
Subject: RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
Quoted 9 lines
-----Original Message-----
From: Gowrishankar Muthukrishnan <[email protected]<mailto:[email protected]>>
Sent: Friday 29 August 2025 13:17
To: Finn, Emma <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>; Ji, Kai <[email protected]<mailto:[email protected]>>
Subject: RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
Importance: High
Quoted 7 lines
Quoted 1 line
SHAKE is not supported by these hence I did not catch it.
OpenSSL PMD supports SHA and SHAKE. Could that help verifying both lines of fix ?.
Thanks,
Gowrishankar.
OpenSSL PMD only supports SHAKE-256 for EdDSA operations, not as standalone hash functions
________________________________
From: Finn, Emma <[email protected]>
Sent: 28 August 2025 10:28
To: Gowrishankar Muthukrishnan <[email protected]>
Cc: [email protected] <[email protected]>; Ji, Kai <[email protected]>; Finn, Emma <[email protected]>
Subject: [PATCH] examples/fips_validation: fix dangling pointer for SHA test
Set vector pointer to NULL after free to avoid calling rte_free() on the same pointer twice in some cases.
--- examples/fips_validation/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/fips_validation/main.c +1 -1
@@ -2612,7 +2612,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 ; }
--
2.34.1
PATCH v2 1/1 examples/fips_validation: fix dangling pointer for SHA and SHAKE test
In reply to Emma FinnSet vector pointer to NULL after free to avoid calling rte_free() on the same pointer twice in some cases.
---
v2:
* add fix to mct_shake_test
--- examples/fips_validation/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
examples/fips_validation/main.c +2 -1
@@ -2610,7 +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 +2698,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 ; }
Signature · 1 line
2.43.0
RE: [EXTERNAL] [v2] examples/fips_validation: fix dangling pointer for SHA and SHAKE test
Quoted 4 lines
Set vector pointer to NULL after free to avoid calling
rte_free()on the same pointer twice in some cases.Signed-off-by Emma Finn <[email protected]>
Thomas Monjalon
AppliedRe: [EXTERNAL] [v2] examples/fips_validation: fix dangling pointer for SHA and SHAKE test
09/03/2026 11:20, Gowrishankar Muthukrishnan:
Quoted 6 lines
Quoted 4 lines
Set vector pointer to NULL after free to avoid calling
rte_free()on the same pointer twice in some cases.Signed-off-by Emma Finn <[email protected]>
Applied, thanks.