[dpdk-dev] [PATCH 2/2] app/crypto-perf: fix memcpy source range
De Lara Guarch, Pablo
pablo.de.lara.guarch at intel.com
Wed May 16 13:40:54 CEST 2018
> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob at caviumnetworks.com]
> Sent: Wednesday, May 16, 2018 7:40 AM
> To: dev at dpdk.org
> Cc: thomas at monjalon.net; Jerin Jacob <jerin.jacob at caviumnetworks.com>; De
> Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>; Doherty, Declan
> <declan.doherty at intel.com>; andy at warmcat.com; stable at dpdk.org
> Subject: [dpdk-dev] [PATCH 2/2] app/crypto-perf: fix memcpy source range
>
> Since arm64 was using plain memcpy for rte_memcpy, gcc 8.1, could detect size
> was more than source address range.
>
> /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 at intel.com
> Cc: declan.doherty at intel.com
> Cc: andy at warmcat.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> ---
> 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..169ecdef3 100644
> --- a/test/test/test_cryptodev.c
> +++ b/test/test/test_cryptodev.c
> @@ -6616,7 +6616,7 @@ test_multi_session_random_usage(void)
> ts_params->session_mpool);
>
> rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
> - sizeof(struct crypto_unittest_params));
> + sizeof(struct crypto_testsuite_params));
Actually, the source address is wrong.
The fix should be:
- rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
+ rte_memcpy(&ut_paramz[i].ut_params, &unittest_params,
Thanks for reporting this issue.
Pablo
More information about the dev
mailing list