lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 20 Jun 2012 10:01:43 -0700
From:	tip-bot for Samuel Liao <samuelliao@...cent.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	acme@...hat.com, linux-kernel@...r.kernel.org, paulus@...ba.org,
	mingo@...hat.com, hpa@...or.com, mingo@...nel.org,
	davidshan@...cent.com, a.p.zijlstra@...llo.nl,
	namhyung.kim@....com, samuelliao@...cent.com, tglx@...utronix.de
Subject: [tip:perf/core] perf annotate:
  Check null of sym pointer before using it

Commit-ID:  c0a58fb2bdf033df433cad9009c7dac4c6b872b0
Gitweb:     http://git.kernel.org/tip/c0a58fb2bdf033df433cad9009c7dac4c6b872b0
Author:     Samuel Liao <samuelliao@...cent.com>
AuthorDate: Tue, 5 Jun 2012 13:14:59 +0800
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 19 Jun 2012 14:30:26 -0300

perf annotate: Check null of sym pointer before using it

Sym may be NULL, and that will cause perf to crash.

Signed-off-by: Shan Wei <davidshan@...cent.com>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Namhyung Kim <namhyung.kim@....com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/4FCD95D3.90209@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/ui/browsers/annotate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 34b1c46..67a2703 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -814,7 +814,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
 {
 	struct disasm_line *pos, *n;
 	struct annotation *notes;
-	const size_t size = symbol__size(sym);
+	size_t size;
 	struct map_symbol ms = {
 		.map = map,
 		.sym = sym,
@@ -834,6 +834,8 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
 	if (sym == NULL)
 		return -1;
 
+	size = symbol__size(sym);
+
 	if (map->dso->annotate_warned)
 		return -1;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ