DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] examples/fips_validation: fix dangling pointer for SHA test
@ 2025-08-28  9:28 Emma Finn
  2025-08-28  9:42 ` [EXTERNAL] " Gowrishankar Muthukrishnan
  0 siblings, 1 reply; 7+ messages in thread
From: Emma Finn @ 2025-08-28  9:28 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: dev, kai.ji, Emma Finn

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 <emma.finn@intel.com>
---
 examples/fips_validation/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index f21826e9d7..60ee9f8dd4 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
  2025-08-28  9:28 [PATCH] examples/fips_validation: fix dangling pointer for SHA test Emma Finn
@ 2025-08-28  9:42 ` Gowrishankar Muthukrishnan
  2025-08-29 10:18   ` Finn, Emma
  0 siblings, 1 reply; 7+ messages in thread
From: Gowrishankar Muthukrishnan @ 2025-08-28  9:42 UTC (permalink / raw)
  To: Emma Finn; +Cc: dev, kai.ji

> 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 <emma.finn@intel.com>
> ---
>  examples/fips_validation/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
> index f21826e9d7..60ee9f8dd4 100644
> --- a/examples/fips_validation/main.c
> +++ b/examples/fips_validation/main.c
> @@ -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
>  	rte_free(val.val);
>  	return 0;
>  }
> --
> 2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
  2025-08-28  9:42 ` [EXTERNAL] " Gowrishankar Muthukrishnan
@ 2025-08-29 10:18   ` Finn, Emma
  2025-08-29 10:23     ` Gowrishankar Muthukrishnan
  0 siblings, 1 reply; 7+ messages in thread
From: Finn, Emma @ 2025-08-29 10:18 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: dev, Ji, Kai

> -----Original Message-----
> From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Sent: Thursday 28 August 2025 10:42
> To: Finn, Emma <emma.finn@intel.com>
> Cc: dev@dpdk.org; Ji, Kai <kai.ji@intel.com>
> Subject: RE: [EXTERNAL] [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.
> >
> > Signed-off-by: Emma Finn <emma.finn@intel.com>
> > ---
> >  examples/fips_validation/main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/examples/fips_validation/main.c
> > b/examples/fips_validation/main.c index f21826e9d7..60ee9f8dd4 100644
> > --- a/examples/fips_validation/main.c
> > +++ b/examples/fips_validation/main.c
> > @@ -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.
> 
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

> Thanks,
> Gowrishankar
> >  	rte_free(val.val);
> >  	return 0;
> >  }
> > --
> > 2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
  2025-08-29 10:18   ` Finn, Emma
@ 2025-08-29 10:23     ` Gowrishankar Muthukrishnan
  2025-08-29 10:40       ` Finn, Emma
  0 siblings, 1 reply; 7+ messages in thread
From: Gowrishankar Muthukrishnan @ 2025-08-29 10:23 UTC (permalink / raw)
  To: Finn, Emma; +Cc: dev, Ji, Kai

> > >  	rte_free(vec.pt.val);
> > > -
> > > +	vec.pt.val = NULL;
> >
> > Same could be the case for fips_mct_shake_test also.
> >
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
  2025-08-29 10:23     ` Gowrishankar Muthukrishnan
@ 2025-08-29 10:40       ` Finn, Emma
  2025-08-29 12:16         ` Gowrishankar Muthukrishnan
  0 siblings, 1 reply; 7+ messages in thread
From: Finn, Emma @ 2025-08-29 10:40 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: dev, Ji, Kai


> -----Original Message-----
> From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Sent: Friday 29 August 2025 11:23
> To: Finn, Emma <emma.finn@intel.com>
> Cc: dev@dpdk.org; Ji, Kai <kai.ji@intel.com>
> Subject: RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer
> for SHA test
> Importance: High
> 
> > > >  	rte_free(vec.pt.val);
> > > > -
> > > > +	vec.pt.val = NULL;
> > >
> > > Same could be the case for fips_mct_shake_test also.
> > >
> > 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

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: 8
IPSEC_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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
  2025-08-29 10:40       ` Finn, Emma
@ 2025-08-29 12:16         ` Gowrishankar Muthukrishnan
  2025-08-29 13:14           ` Finn, Emma
  0 siblings, 1 reply; 7+ messages in thread
From: Gowrishankar Muthukrishnan @ 2025-08-29 12:16 UTC (permalink / raw)
  To: Finn, Emma; +Cc: dev, Ji, Kai

> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer for SHA test
  2025-08-29 12:16         ` Gowrishankar Muthukrishnan
@ 2025-08-29 13:14           ` Finn, Emma
  0 siblings, 0 replies; 7+ messages in thread
From: Finn, Emma @ 2025-08-29 13:14 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: dev, Ji, Kai



> -----Original Message-----
> From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Sent: Friday 29 August 2025 13:17
> To: Finn, Emma <emma.finn@intel.com>
> Cc: dev@dpdk.org; Ji, Kai <kai.ji@intel.com>
> Subject: RE: [EXTERNAL] [PATCH] examples/fips_validation: fix dangling pointer
> for SHA test
> Importance: High
> 
> > 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-08-29 13:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-28  9:28 [PATCH] examples/fips_validation: fix dangling pointer for SHA test Emma Finn
2025-08-28  9:42 ` [EXTERNAL] " Gowrishankar Muthukrishnan
2025-08-29 10:18   ` Finn, Emma
2025-08-29 10:23     ` Gowrishankar Muthukrishnan
2025-08-29 10:40       ` Finn, Emma
2025-08-29 12:16         ` Gowrishankar Muthukrishnan
2025-08-29 13:14           ` Finn, Emma

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).