lkml.org 
[lkml]   [2011]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] perf: fix temporary file ownership check
From
Date
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())) {




\
 
 \ /
  Last update: 2011-08-12 07:21    [W:1.817 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site