[dpdk-dev] event/octeontx: fix snprintf mempool name overflow

Message ID 20180423133933.31334-1-pbhagavatula@caviumnetworks.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

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

Commit Message

Pavan Nikhilesh April 23, 2018, 1:39 p.m. UTC
  Bugzilla-ID: 28
Fixes: f874c1eb1519 ("event/octeontx: create and free timer adapter")

Reported-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 drivers/event/octeontx/timvf_evdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Van Haaren, Harry April 23, 2018, 2:21 p.m. UTC | #1
> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Monday, April 23, 2018 2:40 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] event/octeontx: fix snprintf mempool name overflow
> 
> Bugzilla-ID: 28
> Fixes: f874c1eb1519 ("event/octeontx: create and free timer adapter")
> 
> Reported-by: Harry van Haaren <harry.van.haaren@intel.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>


Nice one, confirmed as fixed!

I wasn't aware Bugzilla had a diff view; The patch as attachment is viewable here:
https://dpdk.org/tracker/attachment.cgi?id=5&action=diff


Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
  
Van Haaren, Harry April 25, 2018, 12:54 p.m. UTC | #2
+CC Thomas, would you take this one asap it fixes a build warning with Meson/GCC 5.4 on Ubuntu with fortified headers.

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Van Haaren, Harry
> Sent: Monday, April 23, 2018 3:21 PM
> To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] event/octeontx: fix snprintf mempool name
> overflow
> 
> > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Monday, April 23, 2018 2:40 PM
> > To: Van Haaren, Harry <harry.van.haaren@intel.com>
> > Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH] event/octeontx: fix snprintf mempool name
> overflow
> >
> > Bugzilla-ID: 28
> > Fixes: f874c1eb1519 ("event/octeontx: create and free timer adapter")
> >
> > Reported-by: Harry van Haaren <harry.van.haaren@intel.com>
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> 
> 
> Nice one, confirmed as fixed!
> 
> I wasn't aware Bugzilla had a diff view; The patch as attachment is viewable
> here:
> https://dpdk.org/tracker/attachment.cgi?id=5&action=diff
> 
> 
> Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
  
Thomas Monjalon April 25, 2018, 2:55 p.m. UTC | #3
25/04/2018 14:54, Van Haaren, Harry:
> 
> +CC Thomas, would you take this one asap it fixes a build warning with Meson/GCC 5.4 on Ubuntu with fortified headers.
> 
> > > Bugzilla-ID: 28
> > > Fixes: f874c1eb1519 ("event/octeontx: create and free timer adapter")
> > >
> > > Reported-by: Harry van Haaren <harry.van.haaren@intel.com>
> > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > 
> > 
> > Nice one, confirmed as fixed!
> > 
> > I wasn't aware Bugzilla had a diff view; The patch as attachment is viewable
> > here:
> > https://dpdk.org/tracker/attachment.cgi?id=5&action=diff

It's nice :)

I have update the Bugzilla ticket, especially the field URL
with the link to see the commit in cgit.

> > Tested-by: Harry van Haaren <harry.van.haaren@intel.com>

Applied, thanks
  
Van Haaren, Harry April 25, 2018, 3:01 p.m. UTC | #4
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Wednesday, April 25, 2018 3:56 PM
> To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Cc: dev@dpdk.org; Van Haaren, Harry <harry.van.haaren@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] event/octeontx: fix snprintf mempool name
> overflow
> 
> 25/04/2018 14:54, Van Haaren, Harry:
> >
> > +CC Thomas, would you take this one asap it fixes a build warning with
> Meson/GCC 5.4 on Ubuntu with fortified headers.
> >
> > > > Bugzilla-ID: 28
> > > > Fixes: f874c1eb1519 ("event/octeontx: create and free timer adapter")
> > > >
> > > > Reported-by: Harry van Haaren <harry.van.haaren@intel.com>
> > > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > >
> > >
> > > Nice one, confirmed as fixed!
> > >
> > > I wasn't aware Bugzilla had a diff view; The patch as attachment is
> viewable
> > > here:
> > > https://dpdk.org/tracker/attachment.cgi?id=5&action=diff
> 
> It's nice :)
> 
> I have update the Bugzilla ticket, especially the field URL
> with the link to see the commit in cgit.

I'm working on documenting a suggested workflow, will include
the steps above.

Thanks!
  

Patch

diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c
index 22f534be6..c4fbd2d86 100644
--- a/drivers/event/octeontx/timvf_evdev.c
+++ b/drivers/event/octeontx/timvf_evdev.c
@@ -294,7 +294,8 @@  timvf_ring_create(struct rte_event_timer_adapter *adptr)
 	if (timr->bkt == NULL)
 		goto mem_err;
 
-	snprintf(pool_name, 30, "timvf_chunk_pool%d", timr->tim_ring_id);
+	snprintf(pool_name, sizeof(pool_name), "timvf_chunk_pool%d",
+			timr->tim_ring_id);
 	timr->chunk_pool = (void *)rte_mempool_create_empty(pool_name,
 			timr->nb_chunks, TIM_CHUNK_SIZE, 0, 0, rte_socket_id(),
 			mp_flags);