DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] app/crypto-perf: use strcpy for allocated string
@ 2018-05-16  6:39 Jerin Jacob
  2018-05-16  6:39 ` [dpdk-dev] [PATCH 2/2] app/crypto-perf: fix memcpy source range Jerin Jacob
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jerin Jacob @ 2018-05-16  6:39 UTC (permalink / raw)
  To: dev; +Cc: thomas, Jerin Jacob, declan.doherty, andy, stable

inlined from ‘cperf_test_vector_get_from_file’ at
../app/test-crypto-perf/cperf_test_vector_parsing.c:578:11:
../app/test-crypto-perf/cperf_test_vector_parsing.c:510:3: error:
‘strncpy’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
   strncpy(entry, line, strlen(line));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../app/test-crypto-perf/cperf_test_vector_parsing.c:528:5: error:
‘strncat’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
     strncat(entry, line, strlen(line));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found this issue with meson build and gcc 8.1.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Cc: declan.doherty@intel.com
Cc: andy@warmcat.com
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test-crypto-perf/cperf_test_vector_parsing.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 26321d004..92932a230 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -506,8 +506,7 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts)
 		if (entry == NULL)
 			return -1;
 
-		memset(entry, 0, strlen(line) + 1);
-		strncpy(entry, line, strlen(line));
+		strcpy(entry, line);
 
 		/* check if entry ends with , or = */
 		if (entry[strlen(entry) - 1] == ','
@@ -524,8 +523,8 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts)
 				if (entry_extended == NULL)
 					goto err;
 				entry = entry_extended;
-
-				strncat(entry, line, strlen(line));
+				/* entry has been allocated accordingly */
+				strcpy(&entry[strlen(entry)], line);
 
 				if (entry[strlen(entry) - 1] != ',')
 					break;
-- 
2.17.0

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

* [dpdk-dev]  [PATCH 2/2] app/crypto-perf: fix memcpy source range
  2018-05-16  6:39 [dpdk-dev] [PATCH 1/2] app/crypto-perf: use strcpy for allocated string Jerin Jacob
@ 2018-05-16  6:39 ` Jerin Jacob
  2018-05-16 11:40   ` De Lara Guarch, Pablo
  2018-05-16  9:50 ` [dpdk-dev] [PATCH 1/2] app/crypto-perf: use strcpy for allocated string De Lara Guarch, Pablo
  2018-05-16 12:28 ` [dpdk-dev] [PATCH v2 " Jerin Jacob
  2 siblings, 1 reply; 11+ messages in thread
From: Jerin Jacob @ 2018-05-16  6:39 UTC (permalink / raw)
  To: dev
  Cc: thomas, Jerin Jacob, pablo.de.lara.guarch, declan.doherty, andy, stable

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@intel.com
Cc: declan.doherty@intel.com
Cc: andy@warmcat.com
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerin.jacob@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));
 
 		test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 				&ut_paramz[i].ut_params,
-- 
2.17.0

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

* Re: [dpdk-dev] [PATCH 1/2] app/crypto-perf: use strcpy for allocated string
  2018-05-16  6:39 [dpdk-dev] [PATCH 1/2] app/crypto-perf: use strcpy for allocated string Jerin Jacob
  2018-05-16  6:39 ` [dpdk-dev] [PATCH 2/2] app/crypto-perf: fix memcpy source range Jerin Jacob
@ 2018-05-16  9:50 ` De Lara Guarch, Pablo
  2018-05-16 12:28 ` [dpdk-dev] [PATCH v2 " Jerin Jacob
  2 siblings, 0 replies; 11+ messages in thread
From: De Lara Guarch, Pablo @ 2018-05-16  9:50 UTC (permalink / raw)
  To: Jerin Jacob, dev; +Cc: thomas, Doherty, Declan, andy, stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jerin Jacob
> Sent: Wednesday, May 16, 2018 7:40 AM
> To: dev@dpdk.org
> Cc: 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 1/2] app/crypto-perf: use strcpy for allocated string
> 
> inlined from ‘cperf_test_vector_get_from_file’ at
> ../app/test-crypto-perf/cperf_test_vector_parsing.c:578:11:
> ../app/test-crypto-perf/cperf_test_vector_parsing.c:510:3: error:
> ‘strncpy’ output truncated before terminating nul copying as many bytes from a
> string as its length [-Werror=stringop-truncation]
>    strncpy(entry, line, strlen(line));
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../app/test-crypto-perf/cperf_test_vector_parsing.c:528:5: error:
> ‘strncat’ output truncated before terminating nul copying as many bytes from a
> string as its length [-Werror=stringop-truncation]
>      strncat(entry, line, strlen(line));
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Found this issue with meson build and gcc 8.1.
> 
> Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> application")
> 
> Cc: declan.doherty@intel.com
> Cc: andy@warmcat.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [dpdk-dev] [PATCH 2/2] app/crypto-perf: fix memcpy source range
  2018-05-16  6:39 ` [dpdk-dev] [PATCH 2/2] app/crypto-perf: fix memcpy source range Jerin Jacob
@ 2018-05-16 11:40   ` De Lara Guarch, Pablo
  2018-05-16 11:59     ` Jerin Jacob
  0 siblings, 1 reply; 11+ messages in thread
From: De Lara Guarch, Pablo @ 2018-05-16 11:40 UTC (permalink / raw)
  To: Jerin Jacob, dev; +Cc: thomas, Doherty, Declan, andy, stable



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Wednesday, May 16, 2018 7:40 AM
> To: dev@dpdk.org
> Cc: thomas@monjalon.net; Jerin Jacob <jerin.jacob@caviumnetworks.com>; De
> Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; andy@warmcat.com; stable@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@intel.com
> Cc: declan.doherty@intel.com
> Cc: andy@warmcat.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@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

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

* Re: [dpdk-dev] [PATCH 2/2] app/crypto-perf: fix memcpy source range
  2018-05-16 11:40   ` De Lara Guarch, Pablo
@ 2018-05-16 11:59     ` Jerin Jacob
  0 siblings, 0 replies; 11+ messages in thread
From: Jerin Jacob @ 2018-05-16 11:59 UTC (permalink / raw)
  To: De Lara Guarch, Pablo; +Cc: dev, thomas, Doherty, Declan, andy, stable

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

Makes sense.

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

Will send the v2.


> Pablo

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

* [dpdk-dev] [PATCH v2 1/2] app/crypto-perf: use strcpy for allocated string
  2018-05-16  6:39 [dpdk-dev] [PATCH 1/2] app/crypto-perf: use strcpy for allocated string Jerin Jacob
  2018-05-16  6:39 ` [dpdk-dev] [PATCH 2/2] app/crypto-perf: fix memcpy source range Jerin Jacob
  2018-05-16  9:50 ` [dpdk-dev] [PATCH 1/2] app/crypto-perf: use strcpy for allocated string De Lara Guarch, Pablo
@ 2018-05-16 12:28 ` Jerin Jacob
  2018-05-16 12:28   ` [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source Jerin Jacob
  2018-05-17 16:31   ` [dpdk-dev] [PATCH v2 1/2] app/crypto-perf: use strcpy for allocated string De Lara Guarch, Pablo
  2 siblings, 2 replies; 11+ messages in thread
From: Jerin Jacob @ 2018-05-16 12:28 UTC (permalink / raw)
  To: dev
  Cc: pablo.de.lara.guarch, thomas, Jerin Jacob, declan.doherty, andy, stable

inlined from ‘cperf_test_vector_get_from_file’ at
../app/test-crypto-perf/cperf_test_vector_parsing.c:578:11:
../app/test-crypto-perf/cperf_test_vector_parsing.c:510:3: error:
‘strncpy’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
   strncpy(entry, line, strlen(line));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../app/test-crypto-perf/cperf_test_vector_parsing.c:528:5: error:
‘strncat’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
     strncat(entry, line, strlen(line));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found this issue with meson build and gcc 8.1.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Cc: declan.doherty@intel.com
Cc: andy@warmcat.com
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
v2: 
- No change
---
 app/test-crypto-perf/cperf_test_vector_parsing.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 26321d004..92932a230 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -506,8 +506,7 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts)
 		if (entry == NULL)
 			return -1;
 
-		memset(entry, 0, strlen(line) + 1);
-		strncpy(entry, line, strlen(line));
+		strcpy(entry, line);
 
 		/* check if entry ends with , or = */
 		if (entry[strlen(entry) - 1] == ','
@@ -524,8 +523,8 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts)
 				if (entry_extended == NULL)
 					goto err;
 				entry = entry_extended;
-
-				strncat(entry, line, strlen(line));
+				/* entry has been allocated accordingly */
+				strcpy(&entry[strlen(entry)], line);
 
 				if (entry[strlen(entry) - 1] != ',')
 					break;
-- 
2.17.0

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

* [dpdk-dev]  [PATCH v2 2/2] app/crypto-perf: fix memcpy source
  2018-05-16 12:28 ` [dpdk-dev] [PATCH v2 " Jerin Jacob
@ 2018-05-16 12:28   ` Jerin Jacob
  2018-05-16 12:44     ` Andy Green
                       ` (2 more replies)
  2018-05-17 16:31   ` [dpdk-dev] [PATCH v2 1/2] app/crypto-perf: use strcpy for allocated string De Lara Guarch, Pablo
  1 sibling, 3 replies; 11+ messages in thread
From: Jerin Jacob @ 2018-05-16 12:28 UTC (permalink / raw)
  To: dev
  Cc: pablo.de.lara.guarch, thomas, Jerin Jacob, declan.doherty, andy, stable

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(
-- 
2.17.0

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

* Re: [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source
  2018-05-16 12:28   ` [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source Jerin Jacob
@ 2018-05-16 12:44     ` Andy Green
  2018-05-16 12:50     ` De Lara Guarch, Pablo
  2018-05-17 16:31     ` De Lara Guarch, Pablo
  2 siblings, 0 replies; 11+ messages in thread
From: Andy Green @ 2018-05-16 12:44 UTC (permalink / raw)
  To: Jerin Jacob, dev; +Cc: pablo.de.lara.guarch, thomas, declan.doherty, stable



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

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

* Re: [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source
  2018-05-16 12:28   ` [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source Jerin Jacob
  2018-05-16 12:44     ` Andy Green
@ 2018-05-16 12:50     ` De Lara Guarch, Pablo
  2018-05-17 16:31     ` De Lara Guarch, Pablo
  2 siblings, 0 replies; 11+ messages in thread
From: De Lara Guarch, Pablo @ 2018-05-16 12:50 UTC (permalink / raw)
  To: Jerin Jacob, dev; +Cc: thomas, Doherty, Declan, andy, stable



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

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

* Re: [dpdk-dev] [PATCH v2 1/2] app/crypto-perf: use strcpy for allocated string
  2018-05-16 12:28 ` [dpdk-dev] [PATCH v2 " Jerin Jacob
  2018-05-16 12:28   ` [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source Jerin Jacob
@ 2018-05-17 16:31   ` De Lara Guarch, Pablo
  1 sibling, 0 replies; 11+ messages in thread
From: De Lara Guarch, Pablo @ 2018-05-17 16:31 UTC (permalink / raw)
  To: Jerin Jacob, dev; +Cc: thomas, Doherty, Declan, andy, stable



> -----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 1/2] app/crypto-perf: use strcpy for allocated
> string
> 
> inlined from ‘cperf_test_vector_get_from_file’ at
> ../app/test-crypto-perf/cperf_test_vector_parsing.c:578:11:
> ../app/test-crypto-perf/cperf_test_vector_parsing.c:510:3: error:
> ‘strncpy’ output truncated before terminating nul copying as many bytes from a
> string as its length [-Werror=stringop-truncation]
>    strncpy(entry, line, strlen(line));
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../app/test-crypto-perf/cperf_test_vector_parsing.c:528:5: error:
> ‘strncat’ output truncated before terminating nul copying as many bytes from a
> string as its length [-Werror=stringop-truncation]
>      strncat(entry, line, strlen(line));
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Found this issue with meson build and gcc 8.1.
> 
> Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> application")
> 
> Cc: declan.doherty@intel.com
> Cc: andy@warmcat.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo

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

* Re: [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source
  2018-05-16 12:28   ` [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source Jerin Jacob
  2018-05-16 12:44     ` Andy Green
  2018-05-16 12:50     ` De Lara Guarch, Pablo
@ 2018-05-17 16:31     ` De Lara Guarch, Pablo
  2 siblings, 0 replies; 11+ messages in thread
From: De Lara Guarch, Pablo @ 2018-05-17 16:31 UTC (permalink / raw)
  To: Jerin Jacob, dev; +Cc: thomas, Doherty, Declan, andy, stable



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

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

end of thread, other threads:[~2018-05-17 16:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16  6:39 [dpdk-dev] [PATCH 1/2] app/crypto-perf: use strcpy for allocated string Jerin Jacob
2018-05-16  6:39 ` [dpdk-dev] [PATCH 2/2] app/crypto-perf: fix memcpy source range Jerin Jacob
2018-05-16 11:40   ` De Lara Guarch, Pablo
2018-05-16 11:59     ` Jerin Jacob
2018-05-16  9:50 ` [dpdk-dev] [PATCH 1/2] app/crypto-perf: use strcpy for allocated string De Lara Guarch, Pablo
2018-05-16 12:28 ` [dpdk-dev] [PATCH v2 " Jerin Jacob
2018-05-16 12:28   ` [dpdk-dev] [PATCH v2 2/2] app/crypto-perf: fix memcpy source Jerin Jacob
2018-05-16 12:44     ` Andy Green
2018-05-16 12:50     ` De Lara Guarch, Pablo
2018-05-17 16:31     ` De Lara Guarch, Pablo
2018-05-17 16:31   ` [dpdk-dev] [PATCH v2 1/2] app/crypto-perf: use strcpy for allocated string De Lara Guarch, Pablo

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