perf: fix for double free in tools/perf stat
PATCH 1/1 perf: fix for double free in tools/perf stat
Fix for double free bug in tools/perf due to dangling thread_map pointer in perf_evlist struct. Code path excercised when perf stat -C switch is used but not set and is followed by another switch.
Example: perf stat -C -e.
--- tools/perf/util/evlist.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/evlist.c +1 -0
@@ -845,6 +845,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) out_delete_threads:thread_map__delete (evlist->threads); + evlist->threads =0 ;return -1 ; }
Signature · 1 line
1.7.10.4
Hi Yasser,
Quoted 14 lines · Yasser Shalabi
Fix for double free bug in
tools/perfdue to danglingthread_mappointer inperf_evliststruct. Code path excercised when perf stat -C switch is used but not set and is followed by another switch.
Example: perf stat -C -e.Signed-off-by Yasser Shalabi <[email protected]>--- tools/perf/util/evlist.c | 1 + 1 file changed, 1 insertion(+)tools/perf/util/evlist.c +0
-0
tools/perf/util/evlist.c int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) · line 848
Quoted 4 lines
tools/perf/util/evlist.c +1
-0@@ -845,6 +845,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) out_delete_threads:thread_map__delete (evlist->threads); + evlist->threads =0 ;
Nitpick - I think NULL is preferred rather than 0.
Other than that,
Thanks,
Namhyung
Quoted 2 lines
tools/perf/util/evlist.c +0
-0return -1 ; }
Em Tue, Oct 07, 2014 at 05:15:41PM +0900, Namhyung Kim escreveu:
Quoted 18 lines
Hi Yasser,
Quoted 15 lines · Yasser Shalabi
Fix for double free bug in
tools/perfdue to danglingthread_mappointer inperf_evliststruct. Code path excercised when perf stat -C switch is used but not set and is followed by another switch.
Example: perf stat -C -e.Signed-off-by Yasser Shalabi <[email protected]>--- tools/perf/util/evlist.c | 1 + 1 file changed, 1 insertion(+)tools/perf/util/evlist.c +0
-0@@ -845,6 +845,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
Quoted 5 lines
tools/perf/util/evlist.c int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) · line 848
Quoted 3 lines
tools/perf/util/evlist.c +1
-0out_delete_threads:thread_map__delete (evlist->threads); + evlist->threads =0 ;Nitpick - I think NULL is preferred rather than 0.
yeah, I fixed that.
Quoted 3 lines
Other than that,
Acked-by Namhyung Kim <[email protected]>
Thanks, applied!
Quoted 6 lines
Thanks,
NamhyungQuoted 2 lines
tools/perf/util/evlist.c +0
-0return -1 ; }
tip-bot for Yasser Shalabi
merge bot[tip:perf/urgent] perf evlist: Fix for double free in tools/ perf stat
In reply to Yasser Shalabiperf evlist: Fix for double free in tools/perf stat
Commit-ID: b2e19a934a36b2b4affcde9c170c0f01afabe50a Gitweb: http://git.kernel.org/tip/b2e19a934a36b2b4affcde9c170c0f01afabe50a Author: Yasser Shalabi <[email protected]> AuthorDate: Sat, 4 Oct 2014 11:37:57 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 15 Oct 2014 16:16:53 -0300
perf evlist: Fix for double free in tools/perf stat
Fix for double free bug in tools/perf due to dangling thread_map pointer in perf_evlist struct.
Code path excercised when perf stat -C switch is used but not set and is followed by another switch.
Example:
perf stat -C -e.
--- tools/perf/util/evlist.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/evlist.c +1 -0
@@ -1003,6 +1003,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) out_delete_threads:thread_map__delete (evlist->threads); + evlist->threads =NULL ;return -1 ; }