perf util: Fix null pointer dereference
A message that is not in the archive (sent off-list or not yet received): [email protected]
Arnaldo Carvalho de Melo
AppliedEm Fri, Jun 05, 2020 at 05:17:40PM +0800, Hongbo Yao escreveu:
Quoted 3 lines
If
config->aggr_mapis Null andconfig->aggr_get_idis not Null, the functionprint_aggr()will still callingarrg_update_shadow(), which can result in accessing the invalid pointer.
Looks legit, but you forgot to add this:
Cc Jiri Olsa <[email protected]>
Fixes 088519f318be ("perf stat: Move the display functions to stat-display.c")
That is not completely correct as this is just moving pre-existing code (and bugs) to a different place, but at least the stable guys will get this fix back to a good number of kernels.
Also you forgot to CC lkml,
Thanks, applied.
- Arnaldo
Quoted 30 lines
Signed-off-by Hongbo Yao <[email protected]>--- tools/perf/util/stat-display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/util/stat-display.c +2
-2@@ -668,7 +668,7 @@ static void print_aggr(struct perf_stat_config *config,int s;bool first; -if (!(config->aggr_map || config->aggr_get_id)) +if (!config->aggr_map || !config->aggr_get_id)return ;aggr_update_shadow (config, evlist);@@ -1169,7 +1169,7 @@ static void print_percore(struct perf_stat_config *config,int s;bool first = true; -if (!(config->aggr_map || config->aggr_get_id)) +if (!config->aggr_map || !config->aggr_get_id)return ;if (config->percore_show_thread)Signature · 1 line
2.20.1
Signature · 1 line
- Arnaldo