public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: fix temporary file ownership check
@ 2011-08-11 20:55 Vasiliy Kulikov
  2011-08-12  5:17 ` Pekka Enberg
  2011-08-14 15:38 ` [tip:perf/core] " tip-bot for Vasiliy Kulikov
  0 siblings, 2 replies; 3+ messages in thread
From: Vasiliy Kulikov @ 2011-08-11 20:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Pekka Enberg, Frederic Weisbecker

A file in /tmp/ might be a symlink, so lstat() should be used
instead of stat().

Cc: Pekka Enberg <penberg@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
---
 tools/perf/util/symbol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index a8b5371..5db39f6 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1506,7 +1506,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
 		struct stat st;
 
-		if (stat(dso->name, &st) < 0)
+		if (lstat(dso->name, &st) < 0)
 			return -1;
 
 		if (st.st_uid && (st.st_uid != geteuid())) {
-- 
1.7.0.4


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

end of thread, other threads:[~2011-08-14 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11 20:55 [PATCH] perf: fix temporary file ownership check Vasiliy Kulikov
2011-08-12  5:17 ` Pekka Enberg
2011-08-14 15:38 ` [tip:perf/core] " tip-bot for Vasiliy Kulikov

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