patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] test: fix uninitialized parameter in table autotest
@ 2017-12-21 15:53 Anatoly Burakov
  2018-01-11 14:17 ` Dumitrescu, Cristian
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoly Burakov @ 2017-12-21 15:53 UTC (permalink / raw)
  To: dev; +Cc: Cristian Dumitrescu, marcinx.kerlin, stable

delete_bulk() copies metadata to pointers provided by the entries
parameter, but in the unit test, they are uninitialized, leading
to rte_table attempting to memcpy into random garbage pointers.

Memsetting pointer table to zero will prevent that from happening.

Fixes: 48f2543cf0a8 ("app/test: add bulk adding and deleting")
Cc: marcinx.kerlin@intel.com
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 test/test/test_table_acl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/test/test_table_acl.c b/test/test/test_table_acl.c
index 08c100f..6fcf4cc 100644
--- a/test/test/test_table_acl.c
+++ b/test/test/test_table_acl.c
@@ -532,6 +532,8 @@ setup_acl_pipeline(void)
 		struct rte_pipeline_table_entry *table_entries[5];
 		int key_found[5];
 
+		memset(table_entries, 0, sizeof(table_entries));
+
 		for (n = 0; n < 5; n++) {
 			memset(&keys[n], 0, sizeof(struct rte_table_acl_rule_delete_params));
 			key_array[n] = &keys[n];
-- 
2.7.4

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

* Re: [dpdk-stable] [PATCH] test: fix uninitialized parameter in table autotest
  2017-12-21 15:53 [dpdk-stable] [PATCH] test: fix uninitialized parameter in table autotest Anatoly Burakov
@ 2018-01-11 14:17 ` Dumitrescu, Cristian
  2018-01-17 23:28   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Dumitrescu, Cristian @ 2018-01-11 14:17 UTC (permalink / raw)
  To: Burakov, Anatoly, dev; +Cc: Kerlin, Marcin, stable



> -----Original Message-----
> From: Burakov, Anatoly
> Sent: Thursday, December 21, 2017 3:53 PM
> To: dev@dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Kerlin, Marcin
> <marcin.kerlin@intel.com>; stable@dpdk.org
> Subject: [PATCH] test: fix uninitialized parameter in table autotest
> 
> delete_bulk() copies metadata to pointers provided by the entries
> parameter, but in the unit test, they are uninitialized, leading
> to rte_table attempting to memcpy into random garbage pointers.
> 
> Memsetting pointer table to zero will prevent that from happening.
> 
> Fixes: 48f2543cf0a8 ("app/test: add bulk adding and deleting")
> Cc: marcinx.kerlin@intel.com
> Cc: stable@dpdk.org
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  test/test/test_table_acl.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/test/test/test_table_acl.c b/test/test/test_table_acl.c
> index 08c100f..6fcf4cc 100644
> --- a/test/test/test_table_acl.c
> +++ b/test/test/test_table_acl.c
> @@ -532,6 +532,8 @@ setup_acl_pipeline(void)
>  		struct rte_pipeline_table_entry *table_entries[5];
>  		int key_found[5];
> 
> +		memset(table_entries, 0, sizeof(table_entries));
> +
>  		for (n = 0; n < 5; n++) {
>  			memset(&keys[n], 0, sizeof(struct
> rte_table_acl_rule_delete_params));
>  			key_array[n] = &keys[n];
> --
> 2.7.4

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

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

* Re: [dpdk-stable] [PATCH] test: fix uninitialized parameter in table autotest
  2018-01-11 14:17 ` Dumitrescu, Cristian
@ 2018-01-17 23:28   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-01-17 23:28 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: stable, Dumitrescu, Cristian, dev, Kerlin, Marcin

> > delete_bulk() copies metadata to pointers provided by the entries
> > parameter, but in the unit test, they are uninitialized, leading
> > to rte_table attempting to memcpy into random garbage pointers.
> > 
> > Memsetting pointer table to zero will prevent that from happening.
> > 
> > Fixes: 48f2543cf0a8 ("app/test: add bulk adding and deleting")
> > Cc: marcinx.kerlin@intel.com
> > Cc: stable@dpdk.org
> > Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> 
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks

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

end of thread, other threads:[~2018-01-17 23:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-21 15:53 [dpdk-stable] [PATCH] test: fix uninitialized parameter in table autotest Anatoly Burakov
2018-01-11 14:17 ` Dumitrescu, Cristian
2018-01-17 23:28   ` Thomas Monjalon

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