public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: Fix ppc64 SEGV in dso__load_sym with debuginfo files
@ 2011-07-25  4:22 Anton Blanchard
  2011-07-25 14:36 ` Eric B Munson
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Blanchard @ 2011-07-25  4:22 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, emunson
  Cc: linux-kernel


64bit PowerPC debuginfo files have an empty function descriptor
section. I hit a SEGV when perf tried to use this section for
symbol resolution.

To fix this we need to check the section is valid and we can
do this by checking for type SHT_PROGBITS.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org>
---

Index: linux-2.6-tip/tools/perf/util/symbol.c
===================================================================
--- linux-2.6-tip.orig/tools/perf/util/symbol.c	2011-07-11 12:49:12.341506269 +1000
+++ linux-2.6-tip/tools/perf/util/symbol.c	2011-07-24 14:48:00.203783423 +1000
@@ -1111,6 +1111,8 @@ static int dso__load_sym(struct dso *dso
 	}
 
 	opdsec = elf_section_by_name(elf, &ehdr, &opdshdr, ".opd", &opdidx);
+	if (opdshdr.sh_type != SHT_PROGBITS)
+		opdsec = NULL;
 	if (opdsec)
 		opddata = elf_rawdata(opdsec, NULL);
 

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

end of thread, other threads:[~2011-07-25 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-25  4:22 [PATCH] perf: Fix ppc64 SEGV in dso__load_sym with debuginfo files Anton Blanchard
2011-07-25 14:36 ` Eric B Munson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox