All of lore.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	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf: fix temporary file ownership check
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Pekka Enberg @ 2011-08-12  5:17 UTC (permalink / raw)
  To: Vasiliy Kulikov
  Cc: linux-kernel, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Frederic Weisbecker

On Fri, 2011-08-12 at 00:55 +0400, Vasiliy Kulikov wrote:
> 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>

Acked-by: Pekka Enberg <penberg@kernel.org>

> ---
>  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())) {



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

* [tip:perf/core] perf: fix temporary file ownership check
  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-bot for Vasiliy Kulikov
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Vasiliy Kulikov @ 2011-08-14 15:38 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, segoon,
	peterz, penberg, fweisbec, tglx, mingo

Commit-ID:  e9b52ef2228cd0bed7a4465c693a39489e2c338d
Gitweb:     http://git.kernel.org/tip/e9b52ef2228cd0bed7a4465c693a39489e2c338d
Author:     Vasiliy Kulikov <segoon@openwall.com>
AuthorDate: Fri, 12 Aug 2011 00:55:37 +0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.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@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20110811205537.GA22864@albatros
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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())) {

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.