[dpdk-dev,v2,2/2] app/crypto-perf: fix memcpy source
diff mbox

Message ID 20180516122804.535-2-jerin.jacob@caviumnetworks.com
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Jerin Jacob May 16, 2018, 12:28 p.m. UTC
Since arm64 was using plain memcpy for rte_memcpy, gcc 8.1, could
detect size was more than source address range. In this case, the
source was wrong.

/export/dpdk.org/test/test/test_cryptodev.c: In function
'test_multi_session_random_usage':
/export/dpdk.org/build/include/rte_memcpy_64.h:364:29: error: 'memcpy'
forming offset [113, 184] is out of the bounds [0, 112] of object
'testsuite_params' with type 'struct crypto_testsuite_params'
[-Werror=array-bounds]
 #define rte_memcpy(d, s, n) memcpy((d), (s), (n))
                             ^~~~~~~~~~~~~~~~~~~~~
/export/dpdk.org/test/test/test_cryptodev.c:6618:3: note: in expansion
of macro 'rte_memcpy'
   rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
   ^~~~~~~~~~
/export/dpdk.org/test/test/test_cryptodev.c:140:39: note:
'testsuite_params' declared here
 static struct crypto_testsuite_params testsuite_params = { NULL };

Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")

Cc: pablo.de.lara.guarch@intel.com
Cc: declan.doherty@intel.com
Cc: andy@warmcat.com
Cc: stable@dpdk.org

Suggested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2:
-  Addressed http://dpdk.org/dev/patchwork/patch/40086/ comments
---
 test/test/test_cryptodev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Green May 16, 2018, 12:44 p.m. UTC | #1
On 05/16/2018 08:28 PM, Jerin Jacob wrote:
> Since arm64 was using plain memcpy for rte_memcpy, gcc 8.1, could
> detect size was more than source address range. In this case, the
> source was wrong.
> 
> /export/dpdk.org/test/test/test_cryptodev.c: In function
> 'test_multi_session_random_usage':
> /export/dpdk.org/build/include/rte_memcpy_64.h:364:29: error: 'memcpy'
> forming offset [113, 184] is out of the bounds [0, 112] of object
> 'testsuite_params' with type 'struct crypto_testsuite_params'
> [-Werror=array-bounds]
>   #define rte_memcpy(d, s, n) memcpy((d), (s), (n))
>                               ^~~~~~~~~~~~~~~~~~~~~
> /export/dpdk.org/test/test/test_cryptodev.c:6618:3: note: in expansion
> of macro 'rte_memcpy'
>     rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
>     ^~~~~~~~~~
> /export/dpdk.org/test/test/test_cryptodev.c:140:39: note:
> 'testsuite_params' declared here
>   static struct crypto_testsuite_params testsuite_params = { NULL };
> 
> Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")
> 
> Cc: pablo.de.lara.guarch@intel.com
> Cc: declan.doherty@intel.com
> Cc: andy@warmcat.com
> Cc: stable@dpdk.org
> 
> Suggested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
> v2:
> -  Addressed http://dpdk.org/dev/patchwork/patch/40086/ comments
> ---
>   test/test/test_cryptodev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
> index 680082f2b..940e3378a 100644
> --- a/test/test/test_cryptodev.c
> +++ b/test/test/test_cryptodev.c
> @@ -6615,7 +6615,7 @@ test_multi_session_random_usage(void)
>   		sessions[i] = rte_cryptodev_sym_session_create(
>   				ts_params->session_mpool);
>   
> -		rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
> +		rte_memcpy(&ut_paramz[i].ut_params, &unittest_params,
>   				sizeof(struct crypto_unittest_params));
>   
>   		test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
> 

No comment on the patch, but FYI gcc got updated to 8.1.1 on F28.

-Andy
Pablo de Lara May 16, 2018, 12:50 p.m. UTC | #2
> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Wednesday, May 16, 2018 1:28 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> thomas@monjalon.net; Jerin Jacob <jerin.jacob@caviumnetworks.com>;
> Doherty, Declan <declan.doherty@intel.com>; andy@warmcat.com;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source
> 
> Since arm64 was using plain memcpy for rte_memcpy, gcc 8.1, could detect size
> was more than source address range. In this case, the source was wrong.
> 
> /export/dpdk.org/test/test/test_cryptodev.c: In function
> 'test_multi_session_random_usage':
> /export/dpdk.org/build/include/rte_memcpy_64.h:364:29: error: 'memcpy'
> forming offset [113, 184] is out of the bounds [0, 112] of object
> 'testsuite_params' with type 'struct crypto_testsuite_params'
> [-Werror=array-bounds]
>  #define rte_memcpy(d, s, n) memcpy((d), (s), (n))
>                              ^~~~~~~~~~~~~~~~~~~~~
> /export/dpdk.org/test/test/test_cryptodev.c:6618:3: note: in expansion of
> macro 'rte_memcpy'
>    rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
>    ^~~~~~~~~~
> /export/dpdk.org/test/test/test_cryptodev.c:140:39: note:
> 'testsuite_params' declared here
>  static struct crypto_testsuite_params testsuite_params = { NULL };
> 
> Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")
> 
> Cc: pablo.de.lara.guarch@intel.com
> Cc: declan.doherty@intel.com
> Cc: andy@warmcat.com
> Cc: stable@dpdk.org
> 
> Suggested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Pablo de Lara May 17, 2018, 4:31 p.m. UTC | #3
> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Wednesday, May 16, 2018 1:28 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> thomas@monjalon.net; Jerin Jacob <jerin.jacob@caviumnetworks.com>;
> Doherty, Declan <declan.doherty@intel.com>; andy@warmcat.com;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source
> 
> Since arm64 was using plain memcpy for rte_memcpy, gcc 8.1, could detect size
> was more than source address range. In this case, the source was wrong.
> 
> /export/dpdk.org/test/test/test_cryptodev.c: In function
> 'test_multi_session_random_usage':
> /export/dpdk.org/build/include/rte_memcpy_64.h:364:29: error: 'memcpy'
> forming offset [113, 184] is out of the bounds [0, 112] of object
> 'testsuite_params' with type 'struct crypto_testsuite_params'
> [-Werror=array-bounds]
>  #define rte_memcpy(d, s, n) memcpy((d), (s), (n))
>                              ^~~~~~~~~~~~~~~~~~~~~
> /export/dpdk.org/test/test/test_cryptodev.c:6618:3: note: in expansion of
> macro 'rte_memcpy'
>    rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
>    ^~~~~~~~~~
> /export/dpdk.org/test/test/test_cryptodev.c:140:39: note:
> 'testsuite_params' declared here
>  static struct crypto_testsuite_params testsuite_params = { NULL };
> 
> Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")
> 
> Cc: pablo.de.lara.guarch@intel.com
> Cc: declan.doherty@intel.com
> Cc: andy@warmcat.com
> Cc: stable@dpdk.org
> 
> Suggested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo

Patch
diff mbox

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index 680082f2b..940e3378a 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -6615,7 +6615,7 @@  test_multi_session_random_usage(void)
 		sessions[i] = rte_cryptodev_sym_session_create(
 				ts_params->session_mpool);
 
-		rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
+		rte_memcpy(&ut_paramz[i].ut_params, &unittest_params,
 				sizeof(struct crypto_unittest_params));
 
 		test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(