mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <jolsa@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl,
	jolsa@redhat.com, fweisbec@gmail.com, tglx@linutronix.de,
	cjashfor@linux.vnet.ibm.com, mingo@elte.hu
Subject: [tip:perf/core] perf hists browser: Fix NULL deref in hists browsing code
Date: Fri, 13 Apr 2012 11:04:18 -0700	[thread overview]
Message-ID: <tip-8493fe1daf15324eb13a4cc2f94e258716daa568@git.kernel.org> (raw)
In-Reply-To: <1333570898-10505-2-git-send-email-jolsa@redhat.com>

Commit-ID:  8493fe1daf15324eb13a4cc2f94e258716daa568
Gitweb:     http://git.kernel.org/tip/8493fe1daf15324eb13a4cc2f94e258716daa568
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Wed, 4 Apr 2012 22:21:31 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 5 Apr 2012 18:58:45 -0300

perf hists browser: Fix NULL deref in hists browsing code

If there's an event with no samples in data file, the perf report
command can segfault after entering the event details menu.

Following steps reproduce the issue:

 # ./perf record -e syscalls:sys_enter_kexec_load,syscalls:sys_enter_mmap ls
 # ./perf report
 # enter '0 syscalls:sys_enter_kexec_load' menu
 # pres ENTER twice

Above steps are valid assuming ls wont run kexec.. ;)

The check for sellection to be NULL is missing. The fix makes sure it's
being check. Above steps now endup with menu being displayed allowing
'Exit' as the only option.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1333570898-10505-2-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ui/browsers/hists.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index d7a1c4a..2f83e5d 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -125,6 +125,9 @@ static int callchain__count_rows(struct rb_root *chain)
 
 static bool map_symbol__toggle_fold(struct map_symbol *self)
 {
+	if (!self)
+		return false;
+
 	if (!self->has_children)
 		return false;
 

  reply	other threads:[~2012-04-13 18:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 20:21 [PATCH 0/8] perf tool: event parsing enhancements/fixes Jiri Olsa
2012-04-04 20:21 ` [PATCH 1/8] perf, tool: Fix NULL deref in hists browsing code Jiri Olsa
2012-04-13 18:04   ` tip-bot for Jiri Olsa [this message]
2012-04-04 20:21 ` [PATCH 2/8] perf, tool: Split term type into value type and term type Jiri Olsa
2012-04-04 20:21 ` [PATCH 3/8] perf, tool: Add list type for event term parsing Jiri Olsa
2012-04-04 20:21 ` [PATCH 4/8] perf, tool: Add hardcoded name term for pmu events Jiri Olsa
2012-04-04 20:21 ` [PATCH 5/8] perf, tool: Add pmu event parse support for branch_sample_type values Jiri Olsa
2012-04-05  4:50   ` Stephane Eranian
2012-04-05  8:59     ` Jiri Olsa
2012-04-05 17:06       ` Stephane Eranian
2012-04-04 20:21 ` [PATCH 6/8] perf, tool: Move parse event automated tests to separated object Jiri Olsa
2012-04-04 20:21 ` [PATCH 7/8] perf, tool: Add support for displaying event parser debug info Jiri Olsa
2012-04-04 20:21 ` [PATCH 8/8] perf, tool: Use allocated list for each parsed event Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-8493fe1daf15324eb13a4cc2f94e258716daa568@git.kernel.org \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome