]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
perf annotate: Fix sizeof_sym_hist overflow issue
authorJiri Olsa <jolsa@kernel.org>
Mon, 5 Oct 2015 18:06:03 +0000 (20:06 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 5 Oct 2015 19:15:38 +0000 (16:15 -0300)
The annotated_source::sizeof_sym_hist could easily overflow int size,
resulting in crash in __symbol__inc_addr_samples.

Changing its type int size_t as was probably intended from beginning
based on the initialization code in symbol__alloc_hist.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1444068369-20978-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.h

index e9996092a093d7ef6af5aa72ac78fdd5cab61d81..cea323d9ee7eabbd2101eff85be5e0f564520b91 100644 (file)
@@ -122,7 +122,7 @@ struct annotated_source {
        struct list_head   source;
        struct source_line *lines;
        int                nr_histograms;
-       int                sizeof_sym_hist;
+       size_t             sizeof_sym_hist;
        struct cyc_hist    *cycles_hist;
        struct sym_hist    histograms[0];
 };