patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v1 0/2] fips validation app fixes
@ 2021-08-12 14:24 Ciara Power
  2021-08-12 14:24 ` [dpdk-stable] [PATCH v1 1/2] examples/fips_validation: fix unused malloc Ciara Power
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ciara Power @ 2021-08-12 14:24 UTC (permalink / raw)
  To: dev; +Cc: stable, roy.fan.zhang, Ciara Power

Included are patches with small fixes for unnecessary memory allocation,
and incomplete resetting of a pointer.

Ciara Power (2):
  examples/fips_validation: fix unused malloc
  examples/fips_validation: fix resetting pointer

 examples/fips_validation/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.25.1


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

* [dpdk-stable] [PATCH v1 1/2] examples/fips_validation: fix unused malloc
  2021-08-12 14:24 [dpdk-stable] [PATCH v1 0/2] fips validation app fixes Ciara Power
@ 2021-08-12 14:24 ` Ciara Power
  2021-08-16 15:21   ` Zhang, Roy Fan
  2021-08-12 14:24 ` [dpdk-stable] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer Ciara Power
  2021-10-05  8:17 ` [dpdk-stable] [EXT] [dpdk-dev] [PATCH v1 0/2] fips validation app fixes Akhil Goyal
  2 siblings, 1 reply; 6+ messages in thread
From: Ciara Power @ 2021-08-12 14:24 UTC (permalink / raw)
  To: dev; +Cc: stable, roy.fan.zhang, Ciara Power, damianx.nowak, Marko Kovacevic

The val.val pointer is allocated memory, however this memory is then
freed in get_writeback_data() without being used beforehand.
The pointer is then allocated memory again before use,
so the very first allocation is removed as it was unnecessary.

Fixes: f4797bae0050 ("examples/fips_validation: support plain SHA")
Cc: damianx.nowak@intel.com
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 examples/fips_validation/main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index c175fe6ac2..2db00620ce 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -1635,7 +1635,6 @@ fips_mct_sha_test(void)
 	int ret;
 	uint32_t i, j;
 
-	val.val = rte_malloc(NULL, (MAX_DIGEST_SIZE*SHA_MD_BLOCK), 0);
 	for (i = 0; i < SHA_MD_BLOCK; i++)
 		md[i].val = rte_malloc(NULL, (MAX_DIGEST_SIZE*2), 0);
 
-- 
2.25.1


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

* [dpdk-stable] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer
  2021-08-12 14:24 [dpdk-stable] [PATCH v1 0/2] fips validation app fixes Ciara Power
  2021-08-12 14:24 ` [dpdk-stable] [PATCH v1 1/2] examples/fips_validation: fix unused malloc Ciara Power
@ 2021-08-12 14:24 ` Ciara Power
  2021-08-16 15:22   ` Zhang, Roy Fan
  2021-10-05  8:17 ` [dpdk-stable] [EXT] [dpdk-dev] [PATCH v1 0/2] fips validation app fixes Akhil Goyal
  2 siblings, 1 reply; 6+ messages in thread
From: Ciara Power @ 2021-08-12 14:24 UTC (permalink / raw)
  To: dev; +Cc: stable, roy.fan.zhang, Ciara Power, Marko Kovacevic

The env.digest memory was freed, but the pointer was not set to NULL
afterwards. This caused an "Invalid Memory" error, as the pointer tries
to free twice.

Fixes: 952e10cdad5e ("examples/fips_validation: support scatter gather list")
Cc: roy.fan.zhang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 examples/fips_validation/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index 2db00620ce..5d14513a58 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -1846,8 +1846,10 @@ fips_test_one_file(void)
 
 	fips_test_clear();
 
-	if (env.digest)
+	if (env.digest) {
 		rte_free(env.digest);
+		env.digest = NULL;
+	}
 	if (env.mbuf)
 		rte_pktmbuf_free(env.mbuf);
 
-- 
2.25.1


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

* Re: [dpdk-stable] [PATCH v1 1/2] examples/fips_validation: fix unused malloc
  2021-08-12 14:24 ` [dpdk-stable] [PATCH v1 1/2] examples/fips_validation: fix unused malloc Ciara Power
@ 2021-08-16 15:21   ` Zhang, Roy Fan
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Roy Fan @ 2021-08-16 15:21 UTC (permalink / raw)
  To: Power, Ciara, dev; +Cc: stable, damianx.nowak, Kovacevic, Marko

> -----Original Message-----
> From: Power, Ciara <ciara.power@intel.com>
> Sent: Thursday, August 12, 2021 3:25 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Power,
> Ciara <ciara.power@intel.com>; damianx.nowak@intel.com; Kovacevic,
> Marko <marko.kovacevic@intel.com>
> Subject: [PATCH v1 1/2] examples/fips_validation: fix unused malloc
> 
> The val.val pointer is allocated memory, however this memory is then
> freed in get_writeback_data() without being used beforehand.
> The pointer is then allocated memory again before use,
> so the very first allocation is removed as it was unnecessary.
> 
> Fixes: f4797bae0050 ("examples/fips_validation: support plain SHA")
> Cc: damianx.nowak@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>  examples/fips_validation/main.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/examples/fips_validation/main.c
> b/examples/fips_validation/main.c
> index c175fe6ac2..2db00620ce 100644
> --- a/examples/fips_validation/main.c
> +++ b/examples/fips_validation/main.c
> @@ -1635,7 +1635,6 @@ fips_mct_sha_test(void)
>  	int ret;
>  	uint32_t i, j;
> 
> -	val.val = rte_malloc(NULL, (MAX_DIGEST_SIZE*SHA_MD_BLOCK), 0);
>  	for (i = 0; i < SHA_MD_BLOCK; i++)
>  		md[i].val = rte_malloc(NULL, (MAX_DIGEST_SIZE*2), 0);
> 
> --
> 2.25.1

Acked-by: Fan Zhang <roy.fan.zhang@intel.com>


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

* Re: [dpdk-stable] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer
  2021-08-12 14:24 ` [dpdk-stable] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer Ciara Power
@ 2021-08-16 15:22   ` Zhang, Roy Fan
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Roy Fan @ 2021-08-16 15:22 UTC (permalink / raw)
  To: Power, Ciara, dev; +Cc: stable, Kovacevic, Marko

> -----Original Message-----
> From: Power, Ciara <ciara.power@intel.com>
> Sent: Thursday, August 12, 2021 3:25 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Power,
> Ciara <ciara.power@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Subject: [PATCH v1 2/2] examples/fips_validation: fix resetting pointer
> 
> The env.digest memory was freed, but the pointer was not set to NULL
> afterwards. This caused an "Invalid Memory" error, as the pointer tries
> to free twice.
> 
> Fixes: 952e10cdad5e ("examples/fips_validation: support scatter gather list")
> Cc: roy.fan.zhang@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>  examples/fips_validation/main.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/examples/fips_validation/main.c
> b/examples/fips_validation/main.c
> index 2db00620ce..5d14513a58 100644
> --- a/examples/fips_validation/main.c
> +++ b/examples/fips_validation/main.c
> @@ -1846,8 +1846,10 @@ fips_test_one_file(void)
> 
>  	fips_test_clear();
> 
> -	if (env.digest)
> +	if (env.digest) {
>  		rte_free(env.digest);
> +		env.digest = NULL;
> +	}
>  	if (env.mbuf)
>  		rte_pktmbuf_free(env.mbuf);
> 
> --
> 2.25.1

Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

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

* Re: [dpdk-stable] [EXT] [dpdk-dev] [PATCH v1 0/2] fips validation app fixes
  2021-08-12 14:24 [dpdk-stable] [PATCH v1 0/2] fips validation app fixes Ciara Power
  2021-08-12 14:24 ` [dpdk-stable] [PATCH v1 1/2] examples/fips_validation: fix unused malloc Ciara Power
  2021-08-12 14:24 ` [dpdk-stable] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer Ciara Power
@ 2021-10-05  8:17 ` Akhil Goyal
  2 siblings, 0 replies; 6+ messages in thread
From: Akhil Goyal @ 2021-10-05  8:17 UTC (permalink / raw)
  To: Ciara Power, dev; +Cc: stable, roy.fan.zhang

> Included are patches with small fixes for unnecessary memory allocation,
> and incomplete resetting of a pointer.
> 
> Ciara Power (2):
>   examples/fips_validation: fix unused malloc
>   examples/fips_validation: fix resetting pointer
> 
>  examples/fips_validation/main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
Series Applied to dpdk-next-crypto

Thanks.

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

end of thread, other threads:[~2021-10-05  8:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 14:24 [dpdk-stable] [PATCH v1 0/2] fips validation app fixes Ciara Power
2021-08-12 14:24 ` [dpdk-stable] [PATCH v1 1/2] examples/fips_validation: fix unused malloc Ciara Power
2021-08-16 15:21   ` Zhang, Roy Fan
2021-08-12 14:24 ` [dpdk-stable] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer Ciara Power
2021-08-16 15:22   ` Zhang, Roy Fan
2021-10-05  8:17 ` [dpdk-stable] [EXT] [dpdk-dev] [PATCH v1 0/2] fips validation app fixes Akhil Goyal

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git