perf probe: Fix event namelist to duplicate string
authorMasami Hiramatsu <mhiramat@redhat.com>
Mon, 7 Dec 2009 17:00:46 +0000 (12:00 -0500)
committerIngo Molnar <mingo@elte.hu>
Mon, 7 Dec 2009 17:33:21 +0000 (18:33 +0100)
commite1d2017b24fb31602f1128e6a8b2afc54c9283cd
tree7d085171e62e7c241438c22ea039d59554873da9
parentd56728b8d7fb3e1e5e5f97b88fdf6b43a35b4f5e
perf probe: Fix event namelist to duplicate string

Fix event namelist to duplicate string. Without duplicating, adding
multiple probes causes stack overwrite bug, because it reuses a
buffer on stack while the buffer is already added in the namelist.
String duplication solves this bug because only contents of the
buffer is copied to the namelist.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091207170046.19230.55557.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/util/probe-event.c