* [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events
@ 2015-09-16 12:52 Masami Hiramatsu
2015-09-18 1:39 ` 平松雅巳 / HIRAMATU,MASAMI
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Masami Hiramatsu @ 2015-09-16 12:52 UTC (permalink / raw)
To: Namhyung Kim, Arnaldo Carvalho de Melo
Cc: linux-perf-users, linux-kernel, Milian Wolff
Fix a segfault bug and a small mistake in perf probe -d.
Since the "ulist" in perf_del_probe_events is never initialized,
strlist__add(ulist, *) always causes a segfault when removing
uprobe events by perf probe -d.
Also, the "str" local variable is never released if fail to
allocate the "klist". This fixes it too.
This has been introduced by the commit e607f1426b58 ("perf probe:
Print deleted events in cmd_probe()").
Reported-by: Milian Wolff <milian.wolff@kdab.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---
tools/perf/builtin-probe.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 94385ee..f7882ae 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -380,8 +380,11 @@ static int perf_del_probe_events(struct strfilter *filter)
goto out;
klist = strlist__new(NULL, NULL);
- if (!klist)
- return -ENOMEM;
+ ulist = strlist__new(NULL, NULL);
+ if (!klist || !ulist) {
+ ret = -ENOMEM;
+ goto out;
+ }
ret = probe_file__get_events(kfd, filter, klist);
if (ret == 0) {
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events
2015-09-16 12:52 [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events Masami Hiramatsu
@ 2015-09-18 1:39 ` 平松雅巳 / HIRAMATU,MASAMI
2015-09-18 21:24 ` Paul Clarke
2015-09-23 8:43 ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2 siblings, 0 replies; 8+ messages in thread
From: 平松雅巳 / HIRAMATU,MASAMI @ 2015-09-18 1:39 UTC (permalink / raw)
To: Namhyung Kim, Arnaldo Carvalho de Melo
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Milian Wolff,
平松雅巳 / HIRAMATU,MASAMI
Hi Arnaldo,
Could you pull this bugfix as an urgent patch, since this fixes a critical
problem?
Thanks,
From: Masami Hiramatsu [mailto:masami.hiramatsu.pt@hitachi.com]
>
>Fix a segfault bug and a small mistake in perf probe -d.
>
>Since the "ulist" in perf_del_probe_events is never initialized,
>strlist__add(ulist, *) always causes a segfault when removing
>uprobe events by perf probe -d.
>
>Also, the "str" local variable is never released if fail to
>allocate the "klist". This fixes it too.
>
>This has been introduced by the commit e607f1426b58 ("perf probe:
>Print deleted events in cmd_probe()").
>
>Reported-by: Milian Wolff <milian.wolff@kdab.com>
>Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
>---
> tools/perf/builtin-probe.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
>diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
>index 94385ee..f7882ae 100644
>--- a/tools/perf/builtin-probe.c
>+++ b/tools/perf/builtin-probe.c
>@@ -380,8 +380,11 @@ static int perf_del_probe_events(struct strfilter *filter)
> goto out;
>
> klist = strlist__new(NULL, NULL);
>- if (!klist)
>- return -ENOMEM;
>+ ulist = strlist__new(NULL, NULL);
>+ if (!klist || !ulist) {
>+ ret = -ENOMEM;
>+ goto out;
>+ }
>
> ret = probe_file__get_events(kfd, filter, klist);
> if (ret == 0) {
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events
@ 2015-09-18 1:39 ` 平松雅巳 / HIRAMATU,MASAMI
0 siblings, 0 replies; 8+ messages in thread
From: 平松雅巳 / HIRAMATU,MASAMI @ 2015-09-18 1:39 UTC (permalink / raw)
To: Namhyung Kim, Arnaldo Carvalho de Melo
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Milian Wolff,
平松雅巳 / HIRAMATU,MASAMI
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1507 bytes --]
Hi Arnaldo,
Could you pull this bugfix as an urgent patch, since this fixes a critical
problem?
Thanks,
From: Masami Hiramatsu [mailto:masami.hiramatsu.pt@hitachi.com]
>
>Fix a segfault bug and a small mistake in perf probe -d.
>
>Since the "ulist" in perf_del_probe_events is never initialized,
>strlist__add(ulist, *) always causes a segfault when removing
>uprobe events by perf probe -d.
>
>Also, the "str" local variable is never released if fail to
>allocate the "klist". This fixes it too.
>
>This has been introduced by the commit e607f1426b58 ("perf probe:
>Print deleted events in cmd_probe()").
>
>Reported-by: Milian Wolff <milian.wolff@kdab.com>
>Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
>---
> tools/perf/builtin-probe.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
>diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
>index 94385ee..f7882ae 100644
>--- a/tools/perf/builtin-probe.c
>+++ b/tools/perf/builtin-probe.c
>@@ -380,8 +380,11 @@ static int perf_del_probe_events(struct strfilter *filter)
> goto out;
>
> klist = strlist__new(NULL, NULL);
>- if (!klist)
>- return -ENOMEM;
>+ ulist = strlist__new(NULL, NULL);
>+ if (!klist || !ulist) {
>+ ret = -ENOMEM;
>+ goto out;
>+ }
>
> ret = probe_file__get_events(kfd, filter, klist);
> if (ret == 0) {
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events
2015-09-18 1:39 ` 平松雅巳 / HIRAMATU,MASAMI
(?)
@ 2015-09-18 14:26 ` Arnaldo Carvalho de Melo
2015-09-18 14:28 ` Arnaldo Carvalho de Melo
-1 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-18 14:26 UTC (permalink / raw)
To: 平松雅巳 / HIRAMATU,MASAMI
Cc: Namhyung Kim, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org, Milian Wolff
Em Fri, Sep 18, 2015 at 01:39:13AM +0000, 平松雅巳 / HIRAMATU,MASAMI escreveu:
> Hi Arnaldo,
>
> Could you pull this bugfix as an urgent patch, since this fixes a critical
> problem?
Sure, thanks for the reminder.
- Arnaldo
> Thanks,
>
> From: Masami Hiramatsu [mailto:masami.hiramatsu.pt@hitachi.com]
> >
> >Fix a segfault bug and a small mistake in perf probe -d.
> >
> >Since the "ulist" in perf_del_probe_events is never initialized,
> >strlist__add(ulist, *) always causes a segfault when removing
> >uprobe events by perf probe -d.
> >
> >Also, the "str" local variable is never released if fail to
> >allocate the "klist". This fixes it too.
> >
> >This has been introduced by the commit e607f1426b58 ("perf probe:
> >Print deleted events in cmd_probe()").
> >
> >Reported-by: Milian Wolff <milian.wolff@kdab.com>
> >Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> >---
> > tools/perf/builtin-probe.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> >diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
> >index 94385ee..f7882ae 100644
> >--- a/tools/perf/builtin-probe.c
> >+++ b/tools/perf/builtin-probe.c
> >@@ -380,8 +380,11 @@ static int perf_del_probe_events(struct strfilter *filter)
> > goto out;
> >
> > klist = strlist__new(NULL, NULL);
> >- if (!klist)
> >- return -ENOMEM;
> >+ ulist = strlist__new(NULL, NULL);
> >+ if (!klist || !ulist) {
> >+ ret = -ENOMEM;
> >+ goto out;
> >+ }
> >
> > ret = probe_file__get_events(kfd, filter, klist);
> > if (ret == 0) {
> >
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events
2015-09-18 14:26 ` Arnaldo Carvalho de Melo
@ 2015-09-18 14:28 ` Arnaldo Carvalho de Melo
2015-09-18 14:31 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-18 14:28 UTC (permalink / raw)
To: 平松雅巳 / HIRAMATU,MASAMI
Cc: Namhyung Kim, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org, Milian Wolff
Em Fri, Sep 18, 2015 at 11:26:22AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Sep 18, 2015 at 01:39:13AM +0000, 平松雅巳 / HIRAMATU,MASAMI escreveu:
> > Hi Arnaldo,
> >
> > Could you pull this bugfix as an urgent patch, since this fixes a critical
> > problem?
>
> Sure, thanks for the reminder.
But it is not applying, checking:
[acme@zoo linux]$ patch -p1 < /wb/1.patch
patching file tools/perf/builtin-probe.c
Hunk #1 FAILED at 380.
1 out of 1 hunk FAILED -- saving rejects to file tools/perf/builtin-probe.c.rej
[acme@zoo linux]$
- Arnaldo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events
2015-09-18 14:28 ` Arnaldo Carvalho de Melo
@ 2015-09-18 14:31 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-18 14:31 UTC (permalink / raw)
To: 平松雅巳 / HIRAMATU,MASAMI
Cc: Namhyung Kim, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org, Milian Wolff
Em Fri, Sep 18, 2015 at 11:28:30AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Sep 18, 2015 at 11:26:22AM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Fri, Sep 18, 2015 at 01:39:13AM +0000, 平松雅巳 / HIRAMATU,MASAMI escreveu:
> > > Could you pull this bugfix as an urgent patch, since this fixes a critical
> > > problem?
> > Sure, thanks for the reminder.
> But it is not applying, checking:
> [acme@zoo linux]$ patch -p1 < /wb/1.patch
> patching file tools/perf/builtin-probe.c
> Hunk #1 FAILED at 380.
> 1 out of 1 hunk FAILED -- saving rejects to file tools/perf/builtin-probe.c.rej
> [acme@zoo linux]$
The way you reported made me somehow think this was for perf/urgent, but
the function it patches is not even there, ok, applying to perf/core.
Applied.
- Arnaldo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events
2015-09-16 12:52 [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events Masami Hiramatsu
2015-09-18 1:39 ` 平松雅巳 / HIRAMATU,MASAMI
@ 2015-09-18 21:24 ` Paul Clarke
2015-09-23 8:43 ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2 siblings, 0 replies; 8+ messages in thread
From: Paul Clarke @ 2015-09-18 21:24 UTC (permalink / raw)
To: Masami Hiramatsu, Namhyung Kim, Arnaldo Carvalho de Melo
Cc: linux-perf-users, linux-kernel, Milian Wolff
On 09/16/2015 07:52 AM, Masami Hiramatsu wrote:
> Fix a segfault bug and a small mistake in perf probe -d.
>
> Since the "ulist" in perf_del_probe_events is never initialized,
> strlist__add(ulist, *) always causes a segfault when removing
> uprobe events by perf probe -d.
>
> Also, the "str" local variable is never released if fail to
> allocate the "klist". This fixes it too.
>
> This has been introduced by the commit e607f1426b58 ("perf probe:
> Print deleted events in cmd_probe()").
>
> Reported-by: Milian Wolff <milian.wolff@kdab.com>
> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> ---
> tools/perf/builtin-probe.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
> index 94385ee..f7882ae 100644
> --- a/tools/perf/builtin-probe.c
> +++ b/tools/perf/builtin-probe.c
> @@ -380,8 +380,11 @@ static int perf_del_probe_events(struct strfilter *filter)
> goto out;
>
> klist = strlist__new(NULL, NULL);
> - if (!klist)
> - return -ENOMEM;
> + ulist = strlist__new(NULL, NULL);
> + if (!klist || !ulist) {
> + ret = -ENOMEM;
> + goto out;
> + }
Newbie here, but if one of "strlist__new()" calls succeeds, don't you
need a corresponding strlist__delete() ?
PC
^ permalink raw reply [flat|nested] 8+ messages in thread
* [tip:perf/core] perf probe: Fix a segfault when removing uprobe events
2015-09-16 12:52 [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events Masami Hiramatsu
2015-09-18 1:39 ` 平松雅巳 / HIRAMATU,MASAMI
2015-09-18 21:24 ` Paul Clarke
@ 2015-09-23 8:43 ` tip-bot for Masami Hiramatsu
2 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2015-09-23 8:43 UTC (permalink / raw)
To: linux-tip-commits
Cc: masami.hiramatsu.pt, mingo, acme, hpa, namhyung, milian.wolff,
tglx, linux-kernel
Commit-ID: 0fb18553478dee5b3d8dc0af4f99a5288e81142f
Gitweb: http://git.kernel.org/tip/0fb18553478dee5b3d8dc0af4f99a5288e81142f
Author: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
AuthorDate: Wed, 16 Sep 2015 21:52:42 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 21 Sep 2015 18:01:17 -0300
perf probe: Fix a segfault when removing uprobe events
Fix a segfault bug and a small mistake in perf probe -d.
Since the "ulist" in perf_del_probe_events is never initialized,
strlist__add(ulist, *) always causes a segfault when removing
uprobe events by perf probe -d.
Also, the "str" local variable is never released if fail to
allocate the "klist". This fixes it too.
This has been introduced by the commit e607f1426b58 ("perf probe:
Print deleted events in cmd_probe()").
Reported-by: Milian Wolff <milian.wolff@kdab.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150916125241.4446.44805.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-probe.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 94385ee..f7882ae 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -380,8 +380,11 @@ static int perf_del_probe_events(struct strfilter *filter)
goto out;
klist = strlist__new(NULL, NULL);
- if (!klist)
- return -ENOMEM;
+ ulist = strlist__new(NULL, NULL);
+ if (!klist || !ulist) {
+ ret = -ENOMEM;
+ goto out;
+ }
ret = probe_file__get_events(kfd, filter, klist);
if (ret == 0) {
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-09-23 8:43 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 12:52 [PATCH perf/core ] [BUGFIX] perf probe: Fix a segfault when removing uprobe events Masami Hiramatsu
2015-09-18 1:39 ` 平松雅巳 / HIRAMATU,MASAMI
2015-09-18 1:39 ` 平松雅巳 / HIRAMATU,MASAMI
2015-09-18 14:26 ` Arnaldo Carvalho de Melo
2015-09-18 14:28 ` Arnaldo Carvalho de Melo
2015-09-18 14:31 ` Arnaldo Carvalho de Melo
2015-09-18 21:24 ` Paul Clarke
2015-09-23 8:43 ` [tip:perf/core] " tip-bot for Masami Hiramatsu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.