[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-e9b52ef2228cd0bed7a4465c693a39489e2c338d@git.kernel.org>
Date: Sun, 14 Aug 2011 15:38:08 GMT
From: tip-bot for Vasiliy Kulikov <segoon@...nwall.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, paulus@...ba.org,
hpa@...or.com, mingo@...hat.com, a.p.zijlstra@...llo.nl,
segoon@...nwall.com, peterz@...radead.org, penberg@...nel.org,
fweisbec@...il.com, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/core] perf: fix temporary file ownership check
Commit-ID: e9b52ef2228cd0bed7a4465c693a39489e2c338d
Gitweb: http://git.kernel.org/tip/e9b52ef2228cd0bed7a4465c693a39489e2c338d
Author: Vasiliy Kulikov <segoon@...nwall.com>
AuthorDate: Fri, 12 Aug 2011 00:55:37 +0400
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 12 Aug 2011 08:28:17 -0300
perf: fix temporary file ownership check
A file in /tmp/ might be a symlink, so lstat() should be used instead of
stat().
Acked-by: Pekka Enberg <penberg@...nel.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Pekka Enberg <penberg@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20110811205537.GA22864@albatros
Signed-off-by: Vasiliy Kulikov <segoon@...nwall.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.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 e142c21..469c026 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())) {
--
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