linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH resend] perf machine: Pass correct string to dso__adjust_kmod_long_name
@ 2015-12-07  2:36 Wang Nan
  2015-12-07  3:33 ` 平松雅巳 / HIRAMATU,MASAMI
  2015-12-08  4:30 ` [tip:perf/core] " tip-bot for Wang Nan
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Nan @ 2015-12-07  2:36 UTC (permalink / raw)
  To: acme, acme, namhyung
  Cc: linux-kernel, pi3orama, lizefan, Wang Nan, Masami Hiramatsu

There's a mistake in dso__adjust_kmod_long_name() that, it use strdup()
to dup the new long_name of a dso, but passes the original string
to dso__set_long_name(). Which causes random crash during cleanup.

Fixes: c03d5184f0e9("perf machine: Adjust dso->long_name for offline module")
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 95a7f60..bfc289c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -576,7 +576,7 @@ static void dso__adjust_kmod_long_name(struct dso *dso, const char *filename)
 	if (!dup_filename)
 		return;
 
-	dso__set_long_name(dso, filename, true);
+	dso__set_long_name(dso, dup_filename, true);
 }
 
 struct map *machine__findnew_module_map(struct machine *machine, u64 start,
-- 
1.8.3.4


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

* RE: [PATCH resend] perf machine: Pass correct string to dso__adjust_kmod_long_name
  2015-12-07  2:36 [PATCH resend] perf machine: Pass correct string to dso__adjust_kmod_long_name Wang Nan
@ 2015-12-07  3:33 ` 平松雅巳 / HIRAMATU,MASAMI
  2015-12-08  4:30 ` [tip:perf/core] " tip-bot for Wang Nan
  1 sibling, 0 replies; 3+ messages in thread
From: 平松雅巳 / HIRAMATU,MASAMI @ 2015-12-07  3:33 UTC (permalink / raw)
  To: 'Wang Nan', acme, acme, namhyung; +Cc: linux-kernel, pi3orama, lizefan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1419 bytes --]

>From: Wang Nan [mailto:wangnan0@huawei.com]
>
>There's a mistake in dso__adjust_kmod_long_name() that, it use strdup()
>to dup the new long_name of a dso, but passes the original string
>to dso__set_long_name(). Which causes random crash during cleanup.
>

Looks good to me:)

Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Thanks!

>Fixes: c03d5184f0e9("perf machine: Adjust dso->long_name for offline module")
>Signed-off-by: Wang Nan <wangnan0@huawei.com>
>Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
>Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
>Cc: Namhyung Kim <namhyung@kernel.org>
>Cc: Zefan Li <lizefan@huawei.com>
>Cc: pi3orama@163.com
>---
> tools/perf/util/machine.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
>index 95a7f60..bfc289c 100644
>--- a/tools/perf/util/machine.c
>+++ b/tools/perf/util/machine.c
>@@ -576,7 +576,7 @@ static void dso__adjust_kmod_long_name(struct dso *dso, const char *filename)
> 	if (!dup_filename)
> 		return;
>
>-	dso__set_long_name(dso, filename, true);
>+	dso__set_long_name(dso, dup_filename, true);
> }
>
> struct map *machine__findnew_module_map(struct machine *machine, u64 start,
>--
>1.8.3.4

ÿôèº{.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] 3+ messages in thread

* [tip:perf/core] perf machine: Pass correct string to dso__adjust_kmod_long_name
  2015-12-07  2:36 [PATCH resend] perf machine: Pass correct string to dso__adjust_kmod_long_name Wang Nan
  2015-12-07  3:33 ` 平松雅巳 / HIRAMATU,MASAMI
@ 2015-12-08  4:30 ` tip-bot for Wang Nan
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Wang Nan @ 2015-12-08  4:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, namhyung, tglx, mingo, wangnan0,
	masami.hiramatsu.pt, hpa, lizefan, acme

Commit-ID:  5dcf16df3ce48b2e4f798b1a11b5de2fc3cfd73a
Gitweb:     http://git.kernel.org/tip/5dcf16df3ce48b2e4f798b1a11b5de2fc3cfd73a
Author:     Wang Nan <wangnan0@huawei.com>
AuthorDate: Mon, 7 Dec 2015 02:36:25 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 7 Dec 2015 18:12:45 -0300

perf machine: Pass correct string to dso__adjust_kmod_long_name

There's a mistake in dso__adjust_kmod_long_name() that it use strdup()
to dup the new long_name of a dso, but passes the original string to
dso__set_long_name(). Which causes random crash during cleanup.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Fixes: c03d5184f0e9 ("perf machine: Adjust dso->long_name for offline module")
Link: http://lkml.kernel.org/r/1449455785-42020-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 95a7f60..bfc289c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -576,7 +576,7 @@ static void dso__adjust_kmod_long_name(struct dso *dso, const char *filename)
 	if (!dup_filename)
 		return;
 
-	dso__set_long_name(dso, filename, true);
+	dso__set_long_name(dso, dup_filename, true);
 }
 
 struct map *machine__findnew_module_map(struct machine *machine, u64 start,

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

end of thread, other threads:[~2015-12-08  4:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-07  2:36 [PATCH resend] perf machine: Pass correct string to dso__adjust_kmod_long_name Wang Nan
2015-12-07  3:33 ` 平松雅巳 / HIRAMATU,MASAMI
2015-12-08  4:30 ` [tip:perf/core] " tip-bot for Wang Nan

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