perf: fix temporary file ownership check
PATCH 1/1 perf: fix temporary file ownership check
A file in /tmp/ might be a symlink, so lstat() should be used instead of stat().
Cc Pekka Enberg <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Signed-off-by Vasiliy Kulikov <[email protected]>
--- tools/perf/util/symbol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/util/symbol.c +1 -1
@@ -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 ())) {
Signature · 1 line
1.7.0.4
Quoted 8 lines · Vasiliy Kulikov
A file in
/tmp/might be a symlink, solstat()should be used instead ofstat().Cc Pekka Enberg <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc Frederic Weisbecker <[email protected]>Cc Peter Zijlstra <[email protected]>Signed-off-by Vasiliy Kulikov <[email protected]>
Acked-by Pekka Enberg <[email protected]>
Quoted 17 lines
--- tools/perf/util/symbol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)tools/perf/util/symbol.c +1
-1@@ -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 ())) {
Commit-ID: e9b52ef2228cd0bed7a4465c693a39489e2c338d Gitweb: http://git.kernel.org/tip/e9b52ef2228cd0bed7a4465c693a39489e2c338d Author: Vasiliy Kulikov <[email protected]> AuthorDate: Fri, 12 Aug 2011 00:55:37 +0400 Committer: Arnaldo Carvalho de Melo <[email protected]> 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 <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Peter Zijlstra <[email protected]>
Signed-off-by Vasiliy Kulikov <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/util/symbol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/util/symbol.c +1 -1
@@ -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 ())) {