patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v2] hash: fix sprintf with snprintf
@ 2019-02-14 12:57 Pallantla Poornima
       [not found] ` <EE76425279735140910E0DBA3963DA361BBA864D@BGSMSX103.gar.corp.intel.com>
  2019-03-26 10:27 ` [dpdk-stable] [PATCH v3] app/test/hash: " Pallantla Poornima
  0 siblings, 2 replies; 4+ messages in thread
From: Pallantla Poornima @ 2019-02-14 12:57 UTC (permalink / raw)
  To: dev
  Cc: reshma.pattan, yipeng1.wang, sameh.gobriel, bruce.richardson,
	pablo.de.lara.guarch, stephen, Pallantla Poornima, stable

sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.

Fixes: 473d1bebce ("hash: allow to store data in hash table")
Cc: stable@dpdk.org

Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
---
v2: Addressed review comment to correct the format specifier of 
hastest_key_lens.
---

 test/test/test_hash_perf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/test/test_hash_perf.c b/test/test/test_hash_perf.c
index 525211180..5648fce02 100644
--- a/test/test/test_hash_perf.c
+++ b/test/test/test_hash_perf.c
@@ -85,9 +85,11 @@ create_table(unsigned int with_data, unsigned int table_index,
 
 	if (with_data)
 		/* Table will store 8-byte data */
-		sprintf(name, "test_hash%d_data", hashtest_key_lens[table_index]);
+		snprintf(name, sizeof(name), "test_hash%u_data",
+				hashtest_key_lens[table_index]);
 	else
-		sprintf(name, "test_hash%d", hashtest_key_lens[table_index]);
+		snprintf(name, sizeof(name), "test_hash%u",
+				hashtest_key_lens[table_index]);
 
 
 	if (with_locks)
-- 
2.17.2

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

* Re: [dpdk-stable] [PATCH v2] hash: fix sprintf with snprintf
       [not found] ` <EE76425279735140910E0DBA3963DA361BBA864D@BGSMSX103.gar.corp.intel.com>
@ 2019-03-25 18:05   ` Wang, Yipeng1
  0 siblings, 0 replies; 4+ messages in thread
From: Wang, Yipeng1 @ 2019-03-25 18:05 UTC (permalink / raw)
  To: Poornima, PallantlaX, dev, Thomas Monjalon
  Cc: Pattan, Reshma, Gobriel, Sameh, Richardson, Bruce,
	De Lara Guarch, Pablo, stephen, stable

Sorry for the late reply, but I noticed the test folder is recently moved under app so you may need a rebase.

Please keep my ack after rebase:  Acked-by: Yipeng Wang <yipeng1.wang at intel.com>

>-----Original Message-----
>From: Poornima, PallantlaX
>Sent: Monday, March 25, 2019 7:43 AM
>To: dev@dpdk.org
>Cc: Pattan, Reshma <reshma.pattan@intel.com>; Wang, Yipeng1 <yipeng1.wang@intel.com>; Gobriel, Sameh
><sameh.gobriel@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, Pablo
><pablo.de.lara.guarch@intel.com>; stephen@networkplumber.org; stable@dpdk.org
>Subject: RE: [PATCH v2] hash: fix sprintf with snprintf
>
>Hi,
>
>>-----Original Message-----
>>From: Poornima, PallantlaX
>>Sent: Thursday, February 14, 2019 6:28 PM
>>To: dev@dpdk.org
>>Cc: Pattan, Reshma <reshma.pattan@intel.com>; Wang, Yipeng1
>><yipeng1.wang@intel.com>; Gobriel, Sameh <sameh.gobriel@intel.com>;
>>Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, Pablo
>><pablo.de.lara.guarch@intel.com>; stephen@networkplumber.org;
>>Poornima, PallantlaX <pallantlax.poornima@intel.com>; stable@dpdk.org
>>Subject: [PATCH v2] hash: fix sprintf with snprintf
>>
>>sprintf function is not secure as it doesn't check the length of string.
>>More secure function snprintf is used.
>>
>>Fixes: 473d1bebce ("hash: allow to store data in hash table")
>>Cc: stable@dpdk.org
>>
>>Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
>>---
>>v2: Addressed review comment to correct the format specifier of
>>hastest_key_lens.
>>---
>
>
>Request for ACK please if there are no comments
>
>Regards,
>Poornima

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

* [dpdk-stable] [PATCH v3] app/test/hash: fix sprintf with snprintf
  2019-02-14 12:57 [dpdk-stable] [PATCH v2] hash: fix sprintf with snprintf Pallantla Poornima
       [not found] ` <EE76425279735140910E0DBA3963DA361BBA864D@BGSMSX103.gar.corp.intel.com>
@ 2019-03-26 10:27 ` Pallantla Poornima
  2019-04-04 23:59   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Pallantla Poornima @ 2019-03-26 10:27 UTC (permalink / raw)
  To: dev
  Cc: reshma.pattan, yipeng1.wang, sameh.gobriel, bruce.richardson,
	pablo.de.lara.guarch, Pallantla Poornima, stable

sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.

Fixes: 473d1bebce ("hash: allow to store data in hash table")
Cc: stable@dpdk.org

Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
---
v3: Rebased.
v2: Addressed review comment to correct the format specifier of 
hastest_key_lens.
---
 app/test/test_hash_perf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c
index 525211180..5648fce02 100644
--- a/app/test/test_hash_perf.c
+++ b/app/test/test_hash_perf.c
@@ -85,9 +85,11 @@ create_table(unsigned int with_data, unsigned int table_index,
 
 	if (with_data)
 		/* Table will store 8-byte data */
-		sprintf(name, "test_hash%d_data", hashtest_key_lens[table_index]);
+		snprintf(name, sizeof(name), "test_hash%u_data",
+				hashtest_key_lens[table_index]);
 	else
-		sprintf(name, "test_hash%d", hashtest_key_lens[table_index]);
+		snprintf(name, sizeof(name), "test_hash%u",
+				hashtest_key_lens[table_index]);
 
 
 	if (with_locks)
-- 
2.17.2


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH v3] app/test/hash: fix sprintf with snprintf
  2019-03-26 10:27 ` [dpdk-stable] [PATCH v3] app/test/hash: " Pallantla Poornima
@ 2019-04-04 23:59   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2019-04-04 23:59 UTC (permalink / raw)
  To: Pallantla Poornima
  Cc: dev, reshma.pattan, yipeng1.wang, sameh.gobriel,
	bruce.richardson, pablo.de.lara.guarch, stable

26/03/2019 11:27, Pallantla Poornima:
> sprintf function is not secure as it doesn't check the length of string.
> More secure function snprintf is used.
> 
> Fixes: 473d1bebce ("hash: allow to store data in hash table")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>

Applied, thanks




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

end of thread, other threads:[~2019-04-04 23:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-14 12:57 [dpdk-stable] [PATCH v2] hash: fix sprintf with snprintf Pallantla Poornima
     [not found] ` <EE76425279735140910E0DBA3963DA361BBA864D@BGSMSX103.gar.corp.intel.com>
2019-03-25 18:05   ` Wang, Yipeng1
2019-03-26 10:27 ` [dpdk-stable] [PATCH v3] app/test/hash: " Pallantla Poornima
2019-04-04 23:59   ` [dpdk-stable] [dpdk-dev] " 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).